Commit d781a14c by 陶光胜

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-store into developer

parents 3a4871e4 1f58e380
......@@ -7,12 +7,12 @@ package com.gic.store.constant;
public enum CreateTypeEnum {
BACKGROUND_ADD(1, "后台新增"),
BATCH_IMPORT(2, "批量导入"),
ORDER(3, "订单生成"),
ERP(4, "erp同步"),
ORDER(3, "增量订单同步"),
ERP(4, "ERP同步"),
API(5, "API接口"),
MEMBER(6, "会员生成"),
BULKORDER(7, "批量导入订单"),
BULKMEMBER(8, "批量导入会员")
MEMBER(6, "增量会员同步"),
BULKORDER(7, "批量订单同步"),
BULKMEMBER(8, "批量会员同步")
;
......
......@@ -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) {
......
......@@ -181,9 +181,9 @@ public class ClerkApiServiceImpl implements ClerkApiService {
// 查询条件对应的storeId
String storeIdByClerkSearch;
if (StringUtils.isNotBlank(clerkSearchDTO.getSearch())) {
List<Integer> storeInfoIdsBySearch = clerkService.getStoreInfoIdsBySearch(enterpriseId, null);
List<Integer> storeInfoIdsBySearch = clerkService.getStoreInfoIdsBySearch(enterpriseId, clerkSearchDTO.getSearch());
if (CollectionUtils.isEmpty(groupIds) || CollectionUtils.isEmpty(storeInfoIdsBySearch)) {
storeIdByClerkSearch = "";
return ServiceResponse.success(new Page<>());
} else {
storeIdByClerkSearch = getStoreIdByStoreInfoIds(storeInfoIdsBySearch, null);
}
......@@ -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());
......@@ -273,6 +278,19 @@ public class ClerkApiServiceImpl implements ClerkApiService {
return ServiceResponse.success(totalClerk);
}
// private String getStoreIdByStoreInfoIds(List<Integer> storeInfoIdsBySearch, String search) {
// StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
// storeSearchDTO.setStoreInfoIds(StringUtils.join(storeInfoIdsBySearch, " "));
// storeSearchDTO.setSearch(search);
// Page<StoreDTO> page = storeApiService.listStore(storeSearchDTO, 1, Integer.MAX_VALUE).getResult();
// if (page == null) {
// return "";
// } else {
// return Optional.ofNullable(page.getResult()).orElse(Collections.emptyList()).stream().map(e -> e.getStoreId().toString())
// .reduce((x, y) -> x + " " + y).orElse("");
// }
// }
private String getStoreIdByStoreInfoIds(List<Integer> storeInfoIdsBySearch, String search) {
StoreSearchDBDTO storeSearchDBDTO = new StoreSearchDBDTO();
storeSearchDBDTO.setStoreInfoIdList(storeInfoIdsBySearch);
......@@ -282,15 +300,15 @@ public class ClerkApiServiceImpl implements ClerkApiService {
.reduce((x, y) -> x + " " + y).orElse("");
}
@SuppressWarnings("unchecked")
private ServiceResponse<Page<StoreDTO>> listStoreIds(ClerkSearchDTO clerkSearchDTO, Integer pageNum,
Integer pageSize) {
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(clerkSearchDTO.getEnterpriseId());
storeSearchDTO.setStoreGroupId(clerkSearchDTO.getStoreGroupId());
storeSearchDTO.setSearchJson(clerkSearchDTO.getSelectJson());
storeSearchDTO.setSearchJson(clerkSearchDTO.getSearchJson());
storeSearchDTO.setStoreIds(clerkSearchDTO.getStoreIds());
// storeSearchDTO.setSearch(clerkSearchDTO.getSearch());
return storeApiService.listStore(storeSearchDTO, pageNum, pageSize,
"storeId,storeName,storeCode,storeInfoId,ownType");
......
......@@ -307,10 +307,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
if (tabStoreGroup == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "主键错误,查询不到数据");
}
ServiceResponse<TabStoreGroup> authValid = validIsDefault(storeGroupId);
if (!authValid.isSuccess()) {
return ServiceResponse.failure(authValid.getCode(), authValid.getMessage());
}
if (setSortValue == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "拖拽排序值不能为空");
}
......
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