Commit d01bf31a by guojx

企微概览接口增加门店状态筛选

parent cf25c2f0
...@@ -13,6 +13,7 @@ import com.gic.haoban.manage.web.qo.wechatwork.WechatWorkOverviewTrendQO; ...@@ -13,6 +13,7 @@ import com.gic.haoban.manage.web.qo.wechatwork.WechatWorkOverviewTrendQO;
import com.gic.haoban.manage.web.utils.AuthorizedUserUtils; import com.gic.haoban.manage.web.utils.AuthorizedUserUtils;
import com.gic.haoban.manage.web.utils.data.DataApiQO; import com.gic.haoban.manage.web.utils.data.DataApiQO;
import com.gic.haoban.manage.web.utils.data.StoreAuthUtils; import com.gic.haoban.manage.web.utils.data.StoreAuthUtils;
import com.gic.haoban.manage.web.utils.data.StoreStatusFilterUtils;
import com.gic.haoban.manage.web.vo.wechatwork.DataPageVO; import com.gic.haoban.manage.web.vo.wechatwork.DataPageVO;
import com.gic.haoban.manage.web.vo.wechatwork.WechatWorkOverviewStoreGroupVO; import com.gic.haoban.manage.web.vo.wechatwork.WechatWorkOverviewStoreGroupVO;
import com.gic.haoban.manage.web.vo.wechatwork.WechatWorkOverviewTrendVO; import com.gic.haoban.manage.web.vo.wechatwork.WechatWorkOverviewTrendVO;
...@@ -60,7 +61,7 @@ public class WechatWorkOverviewController extends NewBaseController { ...@@ -60,7 +61,7 @@ public class WechatWorkOverviewController extends NewBaseController {
List<WechatWorkOverviewVO> voList = storeAuthUtils.getOverview( List<WechatWorkOverviewVO> voList = storeAuthUtils.getOverview(
"data_mbr_scale_haoban_background_overview", "data_mbr_scale_haoban_background_overview",
new JSONObject(), new JSONObject(),
new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()), new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()).setStatusList(StoreStatusFilterUtils.getStoreStatusList(qo.getStoreStatusFilter())),
WechatWorkOverviewVO.class); WechatWorkOverviewVO.class);
return RestResponse.successResult(CollectionUtils.isEmpty(voList) ? null : voList.get(0)); return RestResponse.successResult(CollectionUtils.isEmpty(voList) ? null : voList.get(0));
} }
...@@ -79,7 +80,7 @@ public class WechatWorkOverviewController extends NewBaseController { ...@@ -79,7 +80,7 @@ public class WechatWorkOverviewController extends NewBaseController {
List<WechatWorkOverviewTrendVO> list = storeAuthUtils.getOverview( List<WechatWorkOverviewTrendVO> list = storeAuthUtils.getOverview(
"data_mbr_scale_haoban_background_overview_date", "data_mbr_scale_haoban_background_overview_date",
jsonObject, jsonObject,
new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()), new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()).setStatusList(StoreStatusFilterUtils.getStoreStatusList(qo.getStoreStatusFilter())),
WechatWorkOverviewTrendVO.class); WechatWorkOverviewTrendVO.class);
Map<String, WechatWorkOverviewTrendVO> map = new HashMap<>(); Map<String, WechatWorkOverviewTrendVO> map = new HashMap<>();
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
...@@ -113,7 +114,7 @@ public class WechatWorkOverviewController extends NewBaseController { ...@@ -113,7 +114,7 @@ public class WechatWorkOverviewController extends NewBaseController {
List<WechatWorkOverviewTrendVO> voList = storeAuthUtils.getOverview( List<WechatWorkOverviewTrendVO> voList = storeAuthUtils.getOverview(
"data_mbr_scale_haoban_background_overview_date", "data_mbr_scale_haoban_background_overview_date",
jsonObject, jsonObject,
new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()), new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()).setStatusList(StoreStatusFilterUtils.getStoreStatusList(qo.getStoreStatusFilter())),
WechatWorkOverviewTrendVO.class); WechatWorkOverviewTrendVO.class);
return RestResponse.successResult(CollectionUtils.isEmpty(voList) ? null : voList.get(0)); return RestResponse.successResult(CollectionUtils.isEmpty(voList) ? null : voList.get(0));
} }
...@@ -125,6 +126,7 @@ public class WechatWorkOverviewController extends NewBaseController { ...@@ -125,6 +126,7 @@ public class WechatWorkOverviewController extends NewBaseController {
*/ */
@RequestMapping(value = "store-group") @RequestMapping(value = "store-group")
public RestResponse<DataPageVO<WechatWorkOverviewStoreGroupVO>> storeGroup(@RequestBody WechatWorkOverviewStoreGroupQO qo) { public RestResponse<DataPageVO<WechatWorkOverviewStoreGroupVO>> storeGroup(@RequestBody WechatWorkOverviewStoreGroupQO qo) {
qo.setStatusList(StoreStatusFilterUtils.getStoreStatusList(qo.getStoreStatusFilter()));
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo);
return RestResponse.successResult(storeAuthUtils.getData(new DataApiQO() return RestResponse.successResult(storeAuthUtils.getData(new DataApiQO()
.setPageSize(qo.getPageSize()) .setPageSize(qo.getPageSize())
...@@ -154,6 +156,7 @@ public class WechatWorkOverviewController extends NewBaseController { ...@@ -154,6 +156,7 @@ public class WechatWorkOverviewController extends NewBaseController {
task.setTotalCount(storeGroup(qo).getResult().getTotalNum()); task.setTotalCount(storeGroup(qo).getResult().getTotalNum());
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo);
qo.setStatusList(StoreStatusFilterUtils.getStoreStatusList(qo.getStoreStatusFilter()));
storeAuthUtils.setStoreGroupJsonParam(jsonObject, qo); storeAuthUtils.setStoreGroupJsonParam(jsonObject, qo);
boolean isTotalQuery = qo.getQueryDataType() == 1; boolean isTotalQuery = qo.getQueryDataType() == 1;
......
...@@ -13,4 +13,9 @@ import java.io.Serializable; ...@@ -13,4 +13,9 @@ import java.io.Serializable;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class WechatWorkOverviewQO implements Serializable { public class WechatWorkOverviewQO implements Serializable {
private String storeGroupId; private String storeGroupId;
/**
* 0或者空:全部 1:上线 2:未上线
*/
private Integer storeStatusFilter;
} }
...@@ -15,6 +15,11 @@ import java.io.Serializable; ...@@ -15,6 +15,11 @@ import java.io.Serializable;
public class WechatWorkOverviewStoreGroupQO extends StoreGroupCommonQO implements Serializable { public class WechatWorkOverviewStoreGroupQO extends StoreGroupCommonQO implements Serializable {
/** /**
* 0或者空:全部 1:上线 2:未上线
*/
private Integer storeStatusFilter;
/**
* 1:总数 2:新增 * 1:总数 2:新增
*/ */
@JSONField(serialize = false) @JSONField(serialize = false)
......
...@@ -25,4 +25,9 @@ public class WechatWorkOverviewTrendQO implements Serializable { ...@@ -25,4 +25,9 @@ public class WechatWorkOverviewTrendQO implements Serializable {
* yyyy-MM-dd * yyyy-MM-dd
*/ */
private String endDate; private String endDate;
/**
* 0或者空:全部 1:上线 2:未上线
*/
private Integer storeStatusFilter;
} }
package com.gic.haoban.manage.web.utils.data;
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;
}
}
}
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