Commit 5a349e92 by 王祖波

Merge branch 'feature-2024-11-05-add-store-status-filter' into 'developer'

Feature 2024 11 05 add store status filter

See merge request !2238
parents db53a5fa 8596855a
......@@ -948,6 +948,10 @@ public class StaffApiServiceImpl implements StaffApiService {
storeSearchDTO.setStatusAnyIn(storeStatusList);
}
List<String> resultList = storeService.listStoreIds(storeSearchDTO);
if (CollectionUtils.isEmpty(resultList)) {
return Collections.singletonList("no_store");
}
if (addUnassignedStore && isSuperAdminStore) {
if (!hasStoreStatusFilter || storeStatusList.contains("2")) {
//所有门店权限,且选择了上线门店状态,则添加无归属门店id
......
......@@ -25,6 +25,7 @@ import com.gic.enterprise.api.enums.CustomPageTypeEnum;
import com.gic.enterprise.api.service.*;
import com.gic.haoban.manage.web.qo.StaffAddVO;
import com.gic.haoban.manage.web.utils.CustomSwitcher;
import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils;
import com.gic.haoban.manage.web.vo.*;
import com.gic.marketing.pro.api.service.clerktask.ClerkTaskApiService;
import org.apache.commons.collections.CollectionUtils;
......@@ -1789,60 +1790,81 @@ public class WxStaffController extends WebBaseController {
@RequestMapping("/list-clerk-store")
public RestResponse<Object> listClerkStore(String wxEnterpriseId, String enterpriseId, String clerkId,
@RequestParam(defaultValue = "20") int pageSize, @RequestParam(defaultValue = "1") int currentPage,
String storeSearchParams) {
List<String> storeIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
if (CollectionUtils.isEmpty(storeIdList)) {
String storeSearchParams, Integer storeStatusFilter) {
if (StringUtils.isBlank(enterpriseId)) {
return RestResponse.failure("-1", "企业参数为空");
}
// List<String> storeIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
List<String> storeIdList = this.staffApiService.getHaobanStoreIdsRolesByClerkIdAndStoreStatus(clerkId, wxEnterpriseId,
StoreStatusFilterUtils.getStoreStatusList(storeStatusFilter), null);
if (CollectionUtils.isNotEmpty(storeIdList) && storeIdList.contains("no_store")) {
return RestResponse.failure("-1", "无授权门店");
}
List<StoreListVO> voList = new ArrayList<>();
int totalCount = 0;
List<StoreDTO> storeDTOList = new ArrayList<>();
if (storeIdList.get(0).contains("-1")) {
String storeWidgetId = this.powerService.getStoreWidgetId(null, clerkId);
logger.info("权限-所有门店storeWidgetId={}", storeWidgetId);
Page<Object> pageParam = new Page<Object>();
pageParam.setCurrentPage(currentPage);
pageParam.setPageSize(pageSize);
ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkId);
if(clerkDTO.getClerkType() == 2) {
Page<StoreDTO> page = storeWidgetService.getStoreWidgetStore(storeWidgetId, null, enterpriseId, pageParam,
null, null);
if (page != null) {
storeDTOList = page.getResult();
totalCount = page.getTotalCount();
}
}else if(clerkDTO.getClerkType()==3) {
StoreSearchDTO searchDTO = new StoreSearchDTO() ;
searchDTO.setEnterpriseId(clerkDTO.getEnterpriseId());
Page<StoreDTO> page = this.storeService.storeListPage(pageParam,searchDTO) ;
if (page != null) {
storeDTOList = page.getResult();
totalCount = page.getTotalCount();
}
}
} else {
totalCount = storeIdList.size();
int start = pageSize * (currentPage - 1);
if (start < totalCount) {
int end = start + pageSize;
if (end > totalCount) {
end = totalCount;
}
List<String> subStoreIdList = storeIdList.subList(start, end);
if (CollectionUtils.isNotEmpty(subStoreIdList)) {
logger.info("分页当前页storeid数={}", subStoreIdList.size());
String[] arr = new String[subStoreIdList.size()];
List<StoreDTO> storeList = this.storeService.getStores(subStoreIdList.toArray(arr));
Map<String, StoreDTO> storeMap = storeList.stream()
.collect(Collectors.toMap(StoreDTO::getStoreId, o -> o, (k1, k2) -> k1));
for (String id : subStoreIdList) {
if (null != storeMap.get(id)) {
storeDTOList.add(storeMap.get(id));
}
}
}
}
}
Page<Object> pageParam = new Page<Object>();
pageParam.setCurrentPage(currentPage);
pageParam.setPageSize(pageSize);
StoreSearchDTO searchDTO = new StoreSearchDTO() ;
searchDTO.setEnterpriseId(enterpriseId);
searchDTO.setStatusIn("-3");
if (CollectionUtils.isNotEmpty(storeIdList)) {
searchDTO.setAuthStoreIdList(storeIdList);
}
Page<StoreDTO> resPage = this.storeService.storeListPage(pageParam,searchDTO) ;
if (resPage != null) {
storeDTOList = resPage.getResult();
totalCount = resPage.getTotalCount();
}
// if (storeIdList.get(0).contains("-1")) {
// String storeWidgetId = this.powerService.getStoreWidgetId(null, clerkId);
// logger.info("权限-所有门店storeWidgetId={}", storeWidgetId);
// Page<Object> pageParam = new Page<Object>();
// pageParam.setCurrentPage(currentPage);
// pageParam.setPageSize(pageSize);
// ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkId);
// if(clerkDTO.getClerkType() == 2) {
// Page<StoreDTO> page = storeWidgetService.getStoreWidgetStore(storeWidgetId, null, enterpriseId, pageParam,
// null, null);
// if (page != null) {
// storeDTOList = page.getResult();
// totalCount = page.getTotalCount();
// }
// }else if(clerkDTO.getClerkType()==3) {
// StoreSearchDTO searchDTO = new StoreSearchDTO() ;
// searchDTO.setEnterpriseId(clerkDTO.getEnterpriseId());
// Page<StoreDTO> page = this.storeService.storeListPage(pageParam,searchDTO) ;
// if (page != null) {
// storeDTOList = page.getResult();
// totalCount = page.getTotalCount();
// }
// }
// } else {
// totalCount = storeIdList.size();
// int start = pageSize * (currentPage - 1);
// if (start < totalCount) {
// int end = start + pageSize;
// if (end > totalCount) {
// end = totalCount;
// }
// List<String> subStoreIdList = storeIdList.subList(start, end);
// if (CollectionUtils.isNotEmpty(subStoreIdList)) {
// logger.info("分页当前页storeid数={}", subStoreIdList.size());
// String[] arr = new String[subStoreIdList.size()];
// List<StoreDTO> storeList = this.storeService.getStores(subStoreIdList.toArray(arr));
// Map<String, StoreDTO> storeMap = storeList.stream()
// .collect(Collectors.toMap(StoreDTO::getStoreId, o -> o, (k1, k2) -> k1));
// for (String id : subStoreIdList) {
// if (null != storeMap.get(id)) {
// storeDTOList.add(storeMap.get(id));
// }
// }
// }
// }
// }
if (CollectionUtils.isNotEmpty(storeDTOList)) {
for (StoreDTO store : storeDTOList) {
StoreListVO vo = new StoreListVO();
......@@ -1850,6 +1872,7 @@ public class WxStaffController extends WebBaseController {
vo.setStoreName(store.getStoreName());
vo.setStoreCode(store.getStoreCode());
vo.setEnterpriseId(store.getEnterpriseId());
vo.setStoreStatusFilter(StoreStatusFilterUtils.getStoreStatusFilter(store.getStatus()));
voList.add(vo);
}
}
......@@ -1916,6 +1939,7 @@ public class WxStaffController extends WebBaseController {
vo.setStoreName(dto.getStoreName());
vo.setStoreCode(dto.getStoreCode());
vo.setEnterpriseId(dto.getEnterpriseId());
vo.setStoreStatusFilter(StoreStatusFilterUtils.getStoreStatusFilter(dto.getStatus()));
retList.add(vo);
}
return retList;
......@@ -1924,13 +1948,14 @@ public class WxStaffController extends WebBaseController {
// 区经门店查询
@RequestMapping("search-clerk-store")
public RestResponse<Object> listClerkStoreByParams(String wxEnterpriseId, String enterpriseId, String clerkId,
String storeSearchParams) {
String storeSearchParams, Integer storeStatusFilter) {
if (StringUtils.isEmpty(storeSearchParams)) {
return RestResponse.failure("-1", "查询条件为空");
}
// 如果有权限控制,进行管辖门店过0滤
List<String> authStoreIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
if (CollectionUtils.isEmpty(authStoreIdList)) {
List<String> authStoreIdList = this.staffApiService.getHaobanStoreIdsRolesByClerkIdAndStoreStatus(clerkId, wxEnterpriseId,
StoreStatusFilterUtils.getStoreStatusList(storeStatusFilter), null);
if (CollectionUtils.isNotEmpty(authStoreIdList) && authStoreIdList.contains("no_store")) {
return RestResponse.failure("-1", "无授权门店");
}
Page page = this.page(wxEnterpriseId, enterpriseId, clerkId, 20, 1, storeSearchParams, authStoreIdList);
......
......@@ -36,6 +36,7 @@ import com.gic.haoban.manage.web.vo.content.MaterialConvertVO;
import com.gic.haoban.manage.web.vo.content.SimpleGoodsInfoVO;
import com.gic.haoban.manage.web.qo.content.*;
import com.gic.haoban.manage.web.qo.content.like.ContentMaterialLikeQO;
import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils;
import com.gic.haoban.manage.web.vo.content.*;
import com.gic.haoban.manage.web.vo.content.statistics.ContentMaterialKnowVO;
import com.gic.store.goods.enums.ThirdTypeEnum;
......@@ -91,11 +92,12 @@ public class ContentMaterialController {
*/
@RequestMapping(path = "/column-list")
public RestResponse<List<ContentColumnInfoVO>> queryContentColumn(String enterpriseId, String storeId, String wxEnterpriseId, String clerkId,
Integer columnType) {
Integer columnType,Integer storeStatusFilter) {
List<String> storeIdList = new ArrayList<>();
if (StringUtils.isBlank(storeId)) {
// 区经 获取管辖的权限
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(clerkId, wxEnterpriseId);
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(clerkId, wxEnterpriseId,
StoreStatusFilterUtils.getStoreStatusList(storeStatusFilter));
storeIdList.addAll(storeIds);
} else {
storeIdList.add(storeId);
......@@ -141,7 +143,8 @@ public class ContentMaterialController {
}
if (StringUtils.isBlank(contentMaterialQO.getStoreId())) {
// 区经 获取管辖的权限
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialQO.getClerkId(), contentMaterialQO.getWxEnterpriseId());
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialQO.getClerkId(), contentMaterialQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(contentMaterialQO.getStoreStatusFilter()));
pageQDTO.setStoreIdList(storeIds);
} else {
pageQDTO.setStoreIdList(Collections.singletonList(contentMaterialQO.getStoreId()));
......
......@@ -21,6 +21,7 @@ import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor;
import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO;
import com.gic.haoban.manage.web.qo.content.statistics.*;
import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO;
......@@ -83,7 +84,8 @@ public class MaterialDataStaticsController {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(contentMaterialBaseQO.getStoreId())) {
// 区经 获取管辖的权限
storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialBaseQO.getClerkId(), contentMaterialBaseQO.getWxEnterpriseId());
storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialBaseQO.getClerkId(), contentMaterialBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(contentMaterialBaseQO.getStoreStatusFilter()));
search.setStoreIdList(storeIds);
} else {
storeIds.add(contentMaterialBaseQO.getStoreId());
......@@ -129,7 +131,8 @@ public class MaterialDataStaticsController {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
......@@ -155,7 +158,8 @@ public class MaterialDataStaticsController {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
......@@ -175,7 +179,8 @@ public class MaterialDataStaticsController {
//
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
......@@ -192,7 +197,8 @@ public class MaterialDataStaticsController {
public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUsedData(@RequestBody MaterialStoreAnalyzeDataQO materialStatisticsBaseQO) {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
......@@ -231,7 +237,8 @@ public class MaterialDataStaticsController {
public RestResponse<MaterialPersonalUsedDataVO> queryMaterialUsedReport(@RequestBody MaterialReportQO materialReportQO) {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialReportQO.getStoreStatusFilter()));
} else {
storeIds.add(materialReportQO.getStoreId());
}
......@@ -283,7 +290,8 @@ public class MaterialDataStaticsController {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialReportQO.getStoreStatusFilter()));
} else {
storeIds.add(materialReportQO.getStoreId());
}
......@@ -334,7 +342,8 @@ public class MaterialDataStaticsController {
public RestResponse<MaterialAreaUsedDataVO> queryMaterialAreaUseReport(@RequestBody MaterialReportQO materialReportQO) {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialReportQO.getStoreStatusFilter()));
} else {
storeIds.add(materialReportQO.getStoreId());
}
......@@ -354,7 +363,8 @@ public class MaterialDataStaticsController {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialReportQO.getStoreStatusFilter()));
} else {
storeIds.add(materialReportQO.getStoreId());
}
......@@ -400,7 +410,8 @@ public class MaterialDataStaticsController {
public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUseReportList(@RequestBody MaterialStoreReportQO materialReportQO) {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId());
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialReportQO.getClerkId(), materialReportQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialReportQO.getStoreStatusFilter()));
} else {
storeIds.add(materialReportQO.getStoreId());
}
......
......@@ -42,13 +42,9 @@ public class ClerkStoreAdaptor {
* @param wxEnterpriseId
* @return
*/
public List<String> queryClerkStoreIds(String clerkId, String wxEnterpriseId) {
List<String> storeIds = staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
public List<String> queryClerkStoreIds(String clerkId, String wxEnterpriseId,List<String> storeStatusList) {
List<String> storeIds = staffApiService.getHaobanStoreIdsRolesByClerkIdAndStoreStatus(clerkId, wxEnterpriseId,storeStatusList,null);
if (CollectionUtils.isEmpty(storeIds)) {
log.info("根据区经id查询管辖的门店为空 {} {}", clerkId, wxEnterpriseId);
return Collections.singletonList("-100");
}
if (storeIds.size() == 1 && StringUtils.equals(storeIds.get(0), "-1")) {
// 全部门店权限
log.info("区经有全部门店权限 {}", clerkId);
return Collections.emptyList();
......
......@@ -23,9 +23,11 @@ import com.gic.enterprise.api.service.EnterpriseChannelApiService;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.data.DataIndexApiService;
import com.gic.enterprise.service.CustomSettingApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.web.qo.data.*;
import com.gic.haoban.manage.web.utils.DateFillUtils;
import com.gic.haoban.manage.web.utils.StoreAuthUtils;
import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils;
import com.gic.haoban.manage.web.vo.data.DataMemberExtendVO;
import com.gic.haoban.manage.web.vo.data.SalesStructureVO;
import lombok.extern.slf4j.Slf4j;
......@@ -52,6 +54,8 @@ import java.util.stream.Stream;
@Slf4j
public class DataController {
@Autowired
private StaffApiService staffApiService;
@Autowired
private StoreAuthUtils storeAuthUtils;
@Autowired
private DataIndexApiService dataIndexApiService;
......@@ -487,7 +491,10 @@ public class DataController {
String storeIdParam = jsonObject.getString("storeId");
boolean hasStoreId = StringUtils.isNotBlank(storeIdParam);
if (!hasStoreId) {
getAuthStore(qo.getStoreId(), qo.getClerkId(), qo.getWxEnterpriseId(), jsonObject);
List<String> authStoreIdList = staffApiService.getNotEmptyHaobanStoreIdsRolesByClerkIdAndStoreStatus(qo.getClerkId(), qo.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(jsonObject.getInteger("storeStatusFilter")), true);
jsonObject.put("storeId", authStoreIdList.stream().collect(Collectors.joining(",")));
//getAuthStore(qo.getStoreId(), qo.getClerkId(), qo.getWxEnterpriseId(), jsonObject);
}
String apolloKey = qo.getApolloKey();
......
......@@ -52,6 +52,8 @@ public class ContentMaterialBaseQO extends BasePageInfo {
*/
private String unionId;
private Integer storeStatusFilter;
public String getEnterpriseId() {
return enterpriseId;
}
......@@ -115,4 +117,12 @@ public class ContentMaterialBaseQO extends BasePageInfo {
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public Integer getStoreStatusFilter() {
return storeStatusFilter;
}
public void setStoreStatusFilter(Integer storeStatusFilter) {
this.storeStatusFilter = storeStatusFilter;
}
}
......@@ -68,6 +68,8 @@ public class ContentMaterialQO extends PageQo {
*/
private String goodsId;
private Integer storeStatusFilter;
public Integer getQueryScene() {
return queryScene;
}
......@@ -155,4 +157,12 @@ public class ContentMaterialQO extends PageQo {
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public Integer getStoreStatusFilter() {
return storeStatusFilter;
}
public void setStoreStatusFilter(Integer storeStatusFilter) {
this.storeStatusFilter = storeStatusFilter;
}
}
......@@ -53,6 +53,8 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
*/
private Integer fixedDateDiff;
private Integer storeStatusFilter;
public String getEnterpriseId() {
return enterpriseId;
......@@ -103,6 +105,13 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
this.endDate = endDate;
}
public Integer getStoreStatusFilter() {
return storeStatusFilter;
}
public void setStoreStatusFilter(Integer storeStatusFilter) {
this.storeStatusFilter = storeStatusFilter;
}
public String convertStartDate(Integer fixedDateDiff) {
if (fixedDateDiff == null) {
......
package com.gic.haoban.manage.web.utils.storestatusfilter;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StoreStatusFilterUtils {
/**
* 获取门店实际状态值
* @param storeStatusFilter 0或者空:全部 1:上线 2:未上线 -3 :回收站
* @return
*/
public static List<String> getStoreStatusList(Integer storeStatusFilter) {
if (storeStatusFilter == null || storeStatusFilter == 0) {
return Collections.emptyList();
}
switch (storeStatusFilter) {
case 2:
return Stream.of("3", "6", "7").collect(Collectors.toList());
case -3:
return Stream.of("-3").collect(Collectors.toList());
default:
return Stream.of("2").collect(Collectors.toList());
}
}
public static Integer getStoreStatusFilter(Integer storeStatus) {
switch (storeStatus) {
case 2:
return 1;
case -3:
return -3;
default :
return 2;
}
}
}
......@@ -10,6 +10,20 @@ public class StoreListVO implements Serializable{
private String enterpriseId;
/**
* 1:上线 2:未上线 -3 :回收站
*/
private Integer storeStatusFilter;
public Integer getStoreStatusFilter() {
return storeStatusFilter;
}
public void setStoreStatusFilter(Integer storeStatusFilter) {
this.storeStatusFilter = storeStatusFilter;
}
public String getStoreId() {
return storeId;
}
......
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