Commit f83957f5 by zhiwj

修改bug

parent 8a15369a
......@@ -13,7 +13,7 @@ public class ClerkSearchDTO implements Serializable {
private static final long serialVersionUID = 7888454039825986790L;
private String search;
private Integer storeGroupId;
private String selectJson;
private String searchJson;
private Integer enterpriseId;
private String storeIds;
private Integer currentPage=1;
......@@ -41,12 +41,12 @@ public class ClerkSearchDTO implements Serializable {
this.storeGroupId = storeGroupId;
}
public String getSelectJson() {
return selectJson;
public String getSearchJson() {
return searchJson;
}
public void setSelectJson(String selectJson) {
this.selectJson = selectJson;
public void setSearchJson(String searchJson) {
this.searchJson = searchJson;
}
public void setEnterpriseId(Integer enterpriseId) {
......
......@@ -237,8 +237,12 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override
public ServiceResponse<Integer> getTotalClerk(Integer enterpriseId, ClerkSearchDTO clerkSearchDTO) {
if (clerkSearchDTO.getStoreGroupId() == null) {
return ServiceResponse.failure(ErrorCode.MISS_PARAMETER.getCode(), ErrorCode.MISS_PARAMETER.getMsg());
boolean hasStoreIds = StringUtils.isNotBlank(clerkSearchDTO.getStoreIds());
//如果有门店数据条件,则不判断门店分组数据,因为分店分组数据也是为了获取门店
if (!hasStoreIds) {
if (clerkSearchDTO.getStoreGroupId() == null) {
return ServiceResponse.failure(ErrorCode.MISS_PARAMETER.getCode(), ErrorCode.MISS_PARAMETER.getMsg());
}
}
// 分组的id
List<TabStoreGroup> groupList = storeGroupService.listStoreGroupAndChildren(clerkSearchDTO.getStoreGroupId());
......@@ -246,18 +250,19 @@ 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, clerkSearchDTO.getSearch());
if (CollectionUtils.isEmpty(groupIds) || CollectionUtils.isEmpty(storeInfoIdsBySearch)) {
storeIdByClerkSearch = "";
} else {
storeIdByClerkSearch = getStoreIdByStoreInfoIds(storeInfoIdsBySearch, clerkSearchDTO.getSearch());
storeIdByClerkSearch = getStoreIdByStoreInfoIds(storeInfoIdsBySearch, null);
}
} else {
storeIdByClerkSearch = "";
}
clerkSearchDTO.setEnterpriseId(enterpriseId);
clerkSearchDTO.setStoreIds(storeIdByClerkSearch);
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());
......@@ -292,7 +297,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(clerkSearchDTO.getEnterpriseId());
storeSearchDTO.setStoreGroupId(clerkSearchDTO.getStoreGroupId());
storeSearchDTO.setSearchJson(clerkSearchDTO.getSelectJson());
storeSearchDTO.setSearchJson(clerkSearchDTO.getSearchJson());
storeSearchDTO.setStoreIds(clerkSearchDTO.getStoreIds());
return storeApiService.listStore(storeSearchDTO, pageNum, pageSize,
......
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