Commit 441a1ab6 by zhiwj

修改bug

parent 9153f78b
......@@ -16,6 +16,7 @@ public class ClerkSearchDTO implements Serializable {
private String searchJson;
private Integer enterpriseId;
private String storeIds;
private String storeInfoIds;
private Integer currentPage=1;
private Integer pageSize=20;
private Integer clerkType;
......@@ -121,4 +122,12 @@ public class ClerkSearchDTO implements Serializable {
public void setClerkType(Integer clerkType) {
this.clerkType = clerkType;
}
public String getStoreInfoIds() {
return storeInfoIds;
}
public void setStoreInfoIds(String storeInfoIds) {
this.storeInfoIds = storeInfoIds;
}
}
......@@ -306,7 +306,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
List<Integer> storeInfoIdsBySearch = clerkService.getStoreInfoIdsBySearch(enterpriseId, clerkSearchDTO.getSearch());
if (CollectionUtils.isNotEmpty(storeInfoIdsBySearch)) {
String storeInfoIds = storeInfoIdsBySearch.stream().map(Object::toString).collect(Collectors.joining(" "));
clerkSearchDTO.setStoreIds(storeInfoIds);
clerkSearchDTO.setStoreInfoIds(storeInfoIds);
}
}
......@@ -360,25 +360,15 @@ public class ClerkApiServiceImpl implements ClerkApiService {
return ServiceResponse.failure(ErrorCode.MISS_PARAMETER.getCode(), ErrorCode.MISS_PARAMETER.getMsg());
}
}
// 分组的id
List<TabStoreGroup> groupList = storeGroupService.listStoreGroupAndChildren(clerkSearchDTO.getStoreGroupId());
List<Integer> groupIds = groupList.stream().map(TabStoreGroup::getStoreGroupId).collect(Collectors.toList());
// 查询条件对应的storeId
String storeIdByClerkSearch;
if (StringUtils.isNotBlank(clerkSearchDTO.getSearch())) {
List<Integer> storeInfoIdsBySearch = clerkService.getStoreInfoIdsBySearch(enterpriseId, clerkSearchDTO.getSearch());
if (CollectionUtils.isEmpty(groupIds) || CollectionUtils.isEmpty(storeInfoIdsBySearch)) {
storeIdByClerkSearch = "";
} else {
storeIdByClerkSearch = getStoreIdByStoreInfoIds(storeInfoIdsBySearch, null);
if (CollectionUtils.isNotEmpty(storeInfoIdsBySearch)) {
String storeInfoIds = storeInfoIdsBySearch.stream().map(Object::toString).collect(Collectors.joining(" "));
clerkSearchDTO.setStoreInfoIds(storeInfoIds);
}
} else {
storeIdByClerkSearch = "";
}
clerkSearchDTO.setEnterpriseId(enterpriseId);
if (!hasStoreIds) {
clerkSearchDTO.setStoreIds(storeIdByClerkSearch);
}
ServiceResponse<Page<StoreDTO>> serviceResponse = listStoreIds(clerkSearchDTO, 1, Integer.MAX_VALUE);
if (!serviceResponse.isSuccess()) {
return ServiceResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
......@@ -425,6 +415,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
storeSearchDTO.setStoreGroupId(clerkSearchDTO.getStoreGroupId());
storeSearchDTO.setSearchJson(clerkSearchDTO.getSearchJson());
storeSearchDTO.setStoreIds(clerkSearchDTO.getStoreIds());
storeSearchDTO.setStoreInfoIds(clerkSearchDTO.getStoreInfoIds());
return storeApiService.listStore(storeSearchDTO, pageNum, pageSize,
"storeId,storeName,storeCode,storeInfoId,ownType");
......
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