Commit 8f7af4e9 by 王祖波

数据接口门店维度导购维度修改

parent 1cd8ce7c
......@@ -101,8 +101,14 @@ public class PotentialDataController {
@RequestMapping(path = "/potential/overview")
public RestResponse<PotentialOverviewVO> queryPotentialOverviewReport(@RequestBody PotentialBusiOverviewQO potentialOverviewQO) {
String clerkId = potentialOverviewQO.getClerkId();
List<String> storeIds = getStoreIds(potentialOverviewQO);
Pair<Integer, List<String>> pair = getStoreIds(potentialOverviewQO);
Integer clerkType = pair.getKey();
List<String> storeIds = pair.getValue();
if (StringUtils.isBlank(clerkId) || Objects.equals(clerkType, 2)) {
potentialOverviewQO.setPotGroup(1);
} else {
potentialOverviewQO.setPotGroup(2);
}
// 建联数据
PotentialContactOverviewVO contactOverviewVO = null;
// 转化数据
......@@ -141,7 +147,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/potential/conv-member")
public RestResponse<Page<PotentialMemberConvVO>> queryPotentialConvMember(@RequestBody PotentialConvMemberQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<PotentialMemberConvVO> page = potentialDataAdaptor.pagePotentialConvMember(potentialOverviewQO, storeIds);
List<PotentialMemberConvVO> result = page.getResult();
if (CollectionUtils.isNotEmpty(result)) {
......@@ -157,7 +163,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/potential/contact-detail")
public RestResponse<Page<PotentialContactDetailOverviewVO>> queryPotentialContactReport(@RequestBody PotentialContactOverviewQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<PotentialContactOverviewVO> page = potentialDataAdaptor.pagePotentialContactOverview(potentialOverviewQO, storeIds);
List<PotentialContactOverviewVO> result = page.getResult();
List<PotentialContactDetailOverviewVO> list = null;
......@@ -191,7 +197,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/potential/conv-detail")
public RestResponse<Page<PotentialConvDetailOverviewVO>> queryPotentialConvReport(@RequestBody PotentialConvOverviewQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<PotentialConvOverviewVO> page = potentialDataAdaptor.pagePotentialConvOverview(potentialOverviewQO, storeIds);
List<PotentialConvOverviewVO> result = page.getResult();
List<PotentialConvDetailOverviewVO> list = null;
......@@ -225,7 +231,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/recommend/overview")
public RestResponse<RecommendOverviewVO> queryRecommendOverviewReport(@RequestBody RecommendBusiOverviewQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
// 使用数据
RecommendUsedOverviewVO usedOverviewVO = null;
// 转化数据
......@@ -253,7 +259,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/recommend/used-detail")
public RestResponse<Page<RecommendUsedDetailOverviewVO>> queryRecommendUsedReport(@RequestBody RecommendUsedOverviewQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<RecommendUsedOverviewVO> page = potentialDataAdaptor.pageRecommendUsedOverview(potentialOverviewQO, storeIds);
List<RecommendUsedOverviewVO> result = page.getResult();
List<RecommendUsedDetailOverviewVO> list = null;
......@@ -287,7 +293,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/recommend/conv-detail")
public RestResponse<Page<RecommendConvDetailOverviewVO>> queryRecommendConvReport(@RequestBody RecommendConvOverviewQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<RecommendConvOverviewVO> page = potentialDataAdaptor.pageRecommendConvOverview(potentialOverviewQO, storeIds);
List<RecommendConvOverviewVO> result = page.getResult();
List<RecommendConvDetailOverviewVO> list = null;
......@@ -321,7 +327,7 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/recommend/used-trend")
public RestResponse<Page<RecommendUsedTrendVO>> queryRecommendUsedTrend(@RequestBody RecommendUsedTrendQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<RecommendUsedTrendVO> page = potentialDataAdaptor.pageRecommendUsedTrend(potentialOverviewQO, storeIds);
return RestResponse.successResult(page);
}
......@@ -333,23 +339,24 @@ public class PotentialDataController {
*/
@RequestMapping(path = "/recommend/conv-trend")
public RestResponse<Page<RecommendConvTrendVO>> queryRecommendConvTrend(@RequestBody RecommendConvTrendQO potentialOverviewQO) {
List<String> storeIds = getStoreIds(potentialOverviewQO);
List<String> storeIds = getStoreIds(potentialOverviewQO).getValue();
Page<RecommendConvTrendVO> page = potentialDataAdaptor.pageRecommendConvTrend(potentialOverviewQO, storeIds);
return RestResponse.successResult(page);
}
private List<String> getStoreIds(PotentialStatisticsBaseQO potentialStatisticsBaseQO) {
private Pair<Integer,List<String>> getStoreIds(PotentialStatisticsBaseQO potentialStatisticsBaseQO) {
String clerkId = potentialStatisticsBaseQO.getClerkId();
String wxEnterpriseId = potentialStatisticsBaseQO.getWxEnterpriseId();
String storeId = potentialStatisticsBaseQO.getStoreId();
Integer storeStatusFilter = potentialStatisticsBaseQO.getStoreStatusFilter();
List<String> storeIds = new ArrayList<>();
Integer clerkType = null;
if (StringUtils.isNotBlank(clerkId)) {
ClerkDTO clerkDTO = clerkService.getclerkById(clerkId);
if (clerkDTO == null) {
return Lists.newArrayList("-1");
return new Pair<>(null, Lists.newArrayList("-1"));
}
Integer clerkType = clerkDTO.getClerkType();
clerkType = clerkDTO.getClerkType();
if (clerkType >= 2) {
potentialStatisticsBaseQO.setClerkId("");
if (StringUtils.isBlank(storeId)) {
......@@ -361,6 +368,6 @@ public class PotentialDataController {
if (StringUtils.isNotBlank(storeId)) {
storeIds.add(storeId);
}
return storeIds;
return new Pair<>(clerkType, storeIds);
}
}
......@@ -55,7 +55,9 @@ public class PotentialDataAdaptor {
private static final String RECOMMEND_CONV_TREND = "data_mkt_pos_cut_haoban_conv_date";
private <T> T fetchOverviewData(PotentialOverviewQO potentialOverviewQO, List<String> storeIds, String url, Class<T> clazz) {
potentialOverviewQO.setPotGroup(3);
if (potentialOverviewQO.getPotGroup() == null) {
potentialOverviewQO.setPotGroup(3);
}
Map<String, Object> inlineParams = getOverviewParams(potentialOverviewQO, storeIds);
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), url);
if (result.get("data") == null) {
......
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