Commit 4ce49052 by guojx

好办小程序埋点导购明细接口调整:门店过滤

parent eb9ba0af
...@@ -110,11 +110,11 @@ public class EventTrackingController extends NewBaseController { ...@@ -110,11 +110,11 @@ public class EventTrackingController extends NewBaseController {
JSONObject jsonParam = getOverviewParam(qo); JSONObject jsonParam = getOverviewParam(qo);
List<MapThreadHandlerRequest> list = new ArrayList<>(); List<MapThreadHandlerRequest> list = new ArrayList<>();
// 1 访问次数 2 访问人数 3 访问时长 // 1 访问次数 2 访问人数 3 访问时长
jsonParam.put("orderByField", 1); jsonParam.put("orderByFields", 1);
list.add(new MapThreadHandlerRequest(jsonParam, "data_point_anal_hb_app_module", "1_visitCnt")); list.add(new MapThreadHandlerRequest(jsonParam, "data_point_anal_hb_app_module", "1_visitCnt"));
jsonParam.put("orderByField", 2); jsonParam.put("orderByFields", 2);
list.add(new MapThreadHandlerRequest(jsonParam, "data_point_anal_hb_app_module", "2_visitNum")); list.add(new MapThreadHandlerRequest(jsonParam, "data_point_anal_hb_app_module", "2_visitNum"));
jsonParam.put("orderByField", 3); jsonParam.put("orderByFields", 3);
list.add(new MapThreadHandlerRequest(jsonParam, "data_point_anal_hb_app_module", "3_visitTime")); list.add(new MapThreadHandlerRequest(jsonParam, "data_point_anal_hb_app_module", "3_visitTime"));
Map<String, List<JSONObject>> map = ConcurrencyUtils.concurrencyDataForMap(list); Map<String, List<JSONObject>> map = ConcurrencyUtils.concurrencyDataForMap(list);
...@@ -148,7 +148,9 @@ public class EventTrackingController extends NewBaseController { ...@@ -148,7 +148,9 @@ public class EventTrackingController extends NewBaseController {
public RestResponse<DataPageVO<WechatEventTrackingStoreGroupVO>> storeGroup(@RequestBody WechatEventTrackingStoreGroupQO qo) { public RestResponse<DataPageVO<WechatEventTrackingStoreGroupVO>> storeGroup(@RequestBody WechatEventTrackingStoreGroupQO qo) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
qo.dealWithParam(jsonObject); qo.dealWithParam(jsonObject);
storeAuthUtils.setStoreGroupJsonParam(jsonObject, qo); List<String> statusList = new ArrayList<>();
statusList.add("2");
storeAuthUtils.setStoreGroupJsonParam(jsonObject, qo.setStatusList(statusList));
jsonObject.put("apolloKey", "data_point_anal_hb_app_store"); jsonObject.put("apolloKey", "data_point_anal_hb_app_store");
DataPageVO vo = storeAuthUtils.getDataCommonParent(jsonObject.toJSONString(), qo.getPageNum(), "data_point_anal_hb_app_store", qo.getPageSize(), true, true); DataPageVO vo = storeAuthUtils.getDataCommonParent(jsonObject.toJSONString(), qo.getPageNum(), "data_point_anal_hb_app_store", qo.getPageSize(), true, true);
if (CollectionUtils.isNotEmpty(vo.getRows())) { if (CollectionUtils.isNotEmpty(vo.getRows())) {
...@@ -174,7 +176,9 @@ public class EventTrackingController extends NewBaseController { ...@@ -174,7 +176,9 @@ public class EventTrackingController extends NewBaseController {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
qo.dealWithParam(jsonObject); qo.dealWithParam(jsonObject);
storeAuthUtils.setStoreGroupJsonParam(jsonObject, qo); List<String> statusList = new ArrayList<>();
statusList.add("2");
storeAuthUtils.setStoreGroupJsonParam(jsonObject, qo.setStatusList(statusList));
jsonObject.put("apolloKey", "data_point_anal_hb_app_store"); jsonObject.put("apolloKey", "data_point_anal_hb_app_store");
//Excel的标题是字段进行计算 //Excel的标题是字段进行计算
List<String> indexList = new ArrayList<>(); List<String> indexList = new ArrayList<>();
...@@ -227,8 +231,10 @@ public class EventTrackingController extends NewBaseController { ...@@ -227,8 +231,10 @@ public class EventTrackingController extends NewBaseController {
public RestResponse<DataPageVO<WechatEventTrackingClerkVO>> clerk(@RequestBody WechatEventTrackingClerkDetailQO qo) { public RestResponse<DataPageVO<WechatEventTrackingClerkVO>> clerk(@RequestBody WechatEventTrackingClerkDetailQO qo) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
qo.dealWithParam(jsonObject); qo.dealWithParam(jsonObject);
List<String> statusList = new ArrayList<>();
statusList.add("2");
storeAuthUtils.setStoreGroupJsonParam(jsonObject, new StoreGroupCommonQO() storeAuthUtils.setStoreGroupJsonParam(jsonObject, new StoreGroupCommonQO()
.setStoreGroupId(qo.getStoreGroupId()).setStoreId(qo.getStoreId())); .setStoreGroupId(qo.getStoreGroupId()).setStoreId(qo.getStoreId()).setStatusList(statusList));
Map<String, Object> res = DataApiUtils.http(jsonObject.toJSONString(), "data_point_anal_hb_app_clerk"); Map<String, Object> res = DataApiUtils.http(jsonObject.toJSONString(), "data_point_anal_hb_app_clerk");
DataPageVO<WechatEventTrackingClerkVO> vo = new DataPageVO<>(); DataPageVO<WechatEventTrackingClerkVO> vo = new DataPageVO<>();
...@@ -251,7 +257,10 @@ public class EventTrackingController extends NewBaseController { ...@@ -251,7 +257,10 @@ public class EventTrackingController extends NewBaseController {
@RequestMapping(value = "get-unaffiliated-store") @RequestMapping(value = "get-unaffiliated-store")
public RestResponse<List<String>> getUnaffiliatedStoreByStoreGroupId(String storeGroupId) { public RestResponse<List<String>> getUnaffiliatedStoreByStoreGroupId(String storeGroupId) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
return RestResponse.successResult(storeAuthUtils.getPreStoreIdList(storeGroupId, login.getEnterpriseId())); List<String> statusList = new ArrayList<>();
statusList.add("2");
return RestResponse.successResult(storeAuthUtils.getPreStoreIdListCommon(storeGroupId, login.getEnterpriseId(), statusList));
} }
/** /**
...@@ -271,8 +280,10 @@ public class EventTrackingController extends NewBaseController { ...@@ -271,8 +280,10 @@ public class EventTrackingController extends NewBaseController {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
qo.dealWithParam(jsonObject); qo.dealWithParam(jsonObject);
List<String> statusList = new ArrayList<>();
statusList.add("2");
storeAuthUtils.setStoreGroupJsonParam(jsonObject, new StoreGroupCommonQO() storeAuthUtils.setStoreGroupJsonParam(jsonObject, new StoreGroupCommonQO()
.setStoreGroupId(qo.getStoreGroupId()).setStoreId(qo.getStoreId())); .setStoreGroupId(qo.getStoreGroupId()).setStoreId(qo.getStoreId()).setStatusList(statusList));
jsonObject.put("apolloKey", "data_point_anal_hb_app_clerk"); jsonObject.put("apolloKey", "data_point_anal_hb_app_clerk");
//Excel的标题是字段进行计算 //Excel的标题是字段进行计算
List<String> indexList = new ArrayList<>(); List<String> indexList = new ArrayList<>();
...@@ -314,7 +325,10 @@ public class EventTrackingController extends NewBaseController { ...@@ -314,7 +325,10 @@ public class EventTrackingController extends NewBaseController {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo);
jsonObject.remove("storeGroupId"); jsonObject.remove("storeGroupId");
jsonObject.remove("storeId"); jsonObject.remove("storeId");
storeAuthUtils.setCommonParam(jsonObject, new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()).setStoreId(qo.getStoreId())); List<String> statusList = new ArrayList<>();
statusList.add("2");
storeAuthUtils.setCommonParam(jsonObject, new StoreGroupCommonQO().setStoreGroupId(qo.getStoreGroupId()).setStoreId(qo.getStoreId()).setStatusList(statusList));
return jsonObject; return jsonObject;
} }
} }
...@@ -4,6 +4,7 @@ import lombok.Data; ...@@ -4,6 +4,7 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @Author guojx * @Author guojx
...@@ -42,6 +43,11 @@ public class StoreGroupCommonQO implements Serializable { ...@@ -42,6 +43,11 @@ public class StoreGroupCommonQO implements Serializable {
*/ */
private Integer showStore; private Integer showStore;
/**
* 门店状态
*/
private List<String> statusList;
public boolean isRecycle() { public boolean isRecycle() {
return "-3".equals(nextStoreGroupId); return "-3".equals(nextStoreGroupId);
} }
......
...@@ -55,6 +55,11 @@ public class StoreAuthUtils { ...@@ -55,6 +55,11 @@ public class StoreAuthUtils {
List<String> storeIdList = new ArrayList<>(); List<String> storeIdList = new ArrayList<>();
List<String> statusList = getAllStoreStatus(); List<String> statusList = getAllStoreStatus();
List<String> statusListParam = storeCommonQO.getStatusList();
if (CollectionUtils.isNotEmpty(statusListParam)) {
statusList.retainAll(statusListParam);
}
if (StringUtils.isNotBlank(storeId)) { if (StringUtils.isNotBlank(storeId)) {
storeIdList.addAll(Arrays.stream(storeId.split(",")).collect(Collectors.toList())); storeIdList.addAll(Arrays.stream(storeId.split(",")).collect(Collectors.toList()));
} }
...@@ -246,10 +251,19 @@ public class StoreAuthUtils { ...@@ -246,10 +251,19 @@ public class StoreAuthUtils {
} }
public List<String> getPreStoreIdList(String preStoreGroupId, String enterpriseId) { public List<String> getPreStoreIdList(String preStoreGroupId, String enterpriseId) {
return getPreStoreIdListCommon(preStoreGroupId, enterpriseId, null);
}
public List<String> getPreStoreIdListCommon(String preStoreGroupId, String enterpriseId, List<String> statusList) {
preStoreGroupId = getPreStoreGroupId(preStoreGroupId, enterpriseId); preStoreGroupId = getPreStoreGroupId(preStoreGroupId, enterpriseId);
String[] queryArr = new String[]{preStoreGroupId}; String[] queryArr = new String[]{preStoreGroupId};
List<String> defaultStatusList = getAllStoreStatus();
if (CollectionUtils.isNotEmpty(statusList)) {
defaultStatusList.retainAll(statusList);
}
List<String> storeIdList = storeService.getStoreIdListByGroupId(queryArr, List<String> storeIdList = storeService.getStoreIdListByGroupId(queryArr,
getAllStoreStatus().stream().mapToInt(e -> Integer.parseInt(e)).boxed().collect(Collectors.toList())); defaultStatusList.stream().mapToInt(e -> Integer.parseInt(e)).boxed().collect(Collectors.toList()));
if (CollectionUtils.isEmpty(storeIdList)) { if (CollectionUtils.isEmpty(storeIdList)) {
storeIdList.add(NO_EXIST_STORE_ID); storeIdList.add(NO_EXIST_STORE_ID);
} }
......
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