Commit 3dbdc53b by 王祖波

cms数据接口迁移

parent a27c753f
......@@ -17,9 +17,7 @@ import com.gic.haoban.manage.api.enums.content.MaterialReportType;
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.MaterialAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStatisticsBaseQO;
import com.gic.haoban.manage.web.qo.content.statistics.*;
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;
......@@ -171,8 +169,7 @@ public class MaterialDataStaticsController {
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
Page<MaterialClerkUsedDataVO> clerkUsedData = materialDataAdaptor.queryMaterialClerkUsedData(materialStatisticsBaseQO.getEnterpriseId(), storeIds,
materialStatisticsBaseQO.getFixedDateDiff(), materialStatisticsBaseQO.getOrderByField(), materialStatisticsBaseQO.getOrder(), materialStatisticsBaseQO.getPageNum(), materialStatisticsBaseQO.getPageSize());
Page<MaterialClerkUsedDataVO> clerkUsedData = materialDataAdaptor.queryMaterialClerkUsedData(materialStatisticsBaseQO,storeIds);
return RestResponse.successResult(clerkUsedData);
}
......@@ -182,15 +179,14 @@ public class MaterialDataStaticsController {
* @return
*/
@RequestMapping(path = "/content/material/store/data")
public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUsedData(@RequestBody MaterialAnalyzeDataQO materialStatisticsBaseQO) {
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());
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO.getEnterpriseId(), storeIds,
materialStatisticsBaseQO.getFixedDateDiff(), materialStatisticsBaseQO.getOrderByField(), materialStatisticsBaseQO.getOrder(), materialStatisticsBaseQO.getPageNum(), materialStatisticsBaseQO.getPageSize());
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO,storeIds);
if (CollectionUtils.isNotEmpty(storeUsedData.getResult())) {
List<String> tempStoreIds = storeUsedData.getResult()
.stream()
......@@ -273,7 +269,7 @@ public class MaterialDataStaticsController {
* @return
*/
@RequestMapping(path = "/content/material/store/used/data")
public RestResponse<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(@RequestBody MaterialReportQO materialReportQO) {
public RestResponse<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(@RequestBody MaterialStoreReportQO materialReportQO) {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialReportQO.getStoreId())) {
......@@ -391,7 +387,7 @@ public class MaterialDataStaticsController {
* @return
*/
@RequestMapping(path = "/content/material/store/used/data/list")
public RestResponse<Page<MaterialStoreUsedDataVO>> queryMaterialStoreUseReportList(@RequestBody MaterialReportQO materialReportQO) {
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());
......
......@@ -6,10 +6,15 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DataApiUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStoreAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStoreReportQO;
import com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
......@@ -101,19 +106,16 @@ public class MaterialDataAdaptor {
* @return
*/
public MaterialTodayDataBO queryMaterialTodayData(String enterpriseId, List<String> storeIds) {
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams);
inlineParams.put("enterpriseId", enterpriseId);
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), MATERIAL_INDEX_DATA);
Map<String, Object> result = DataApiUtils.http(inlineParams.toString(), MATERIAL_INDEX_DATA);
if (result.get("data") == null) {
return MaterialTodayDataBO.empty();
}
List<MaterialTodayDataBO> datas = JSON.parseArray(JSON.toJSONString(result.get("data")), MaterialTodayDataBO.class);
List<MaterialTodayDataBO> datas = DataApiUtils.parseDataList(result, MaterialTodayDataBO.class);
if (CollectionUtils.isEmpty(datas)) {
return MaterialTodayDataBO.empty();
}
......@@ -131,20 +133,15 @@ public class MaterialDataAdaptor {
* @return
*/
public MaterialDataOverviewVO queryMaterialDataOverview(String enterpriseId, List<String> storeIds, Integer fixedDateDiff) {
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams);
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("fixedDateDiff", fixedDateDiff);
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), MATERIAL_OVERVIEW_DATA);
if (result.get("data") == null) {
return new MaterialDataOverviewVO();
}
List<MaterialDataOverviewVO> datas = JSON.parseArray(JSON.toJSONString(result.get("data")), MaterialDataOverviewVO.class);
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_OVERVIEW_DATA);
List<MaterialDataOverviewVO> datas = DataApiUtils.parseDataList(result, MaterialDataOverviewVO.class);
if (CollectionUtils.isEmpty(datas)) {
return new MaterialDataOverviewVO();
}
......@@ -155,44 +152,30 @@ public class MaterialDataAdaptor {
/**
* 导购纬度数据统计
*
* @param enterpriseId
* @param storeIds
* @param fixedDateDiff
* @param orderStr
* @return
*/
public Page<MaterialClerkUsedDataVO> queryMaterialClerkUsedData(String enterpriseId, List<String> storeIds, Integer fixedDateDiff,
String orderField, String orderStr, Integer pageNo, Integer pageSize) {
Map<String, Object> params = new HashMap<>();
public Page<MaterialClerkUsedDataVO> queryMaterialClerkUsedData(MaterialAnalyzeDataQO dataQO,List<String> storeIds) {
int pageNum = dataQO.getPageNum();
int pageSize = dataQO.getPageSize();
String enterpriseId = dataQO.getEnterpriseId();
Integer fixedDateDiff = dataQO.getFixedDateDiff();
String orderByField = dataQO.getOrderByField();
String order = dataQO.getOrder();
Map<String, Object> inlineParams = new HashMap<>();
params.put("pageNo", pageNo);
params.put("pageSize", pageSize);
params.put("inFields", inlineParams);
inlineParams.put("pageNum", pageNum);
inlineParams.put("pageSize", pageSize);
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("fixedDateDiff", fixedDateDiff);
if (StringUtils.isNotBlank(orderField)) {
inlineParams.put("orderByField", orderField + " " +orderStr);
}else {
inlineParams.put("orderByField", "enterpriseId asc ");
}
int orderByFields = DataApiUtils.getOrderByFields(orderByField, "enterpriseId", dataQO.getFieldsOrder());
inlineParams.put("orderByFields", orderByFields);
inlineParams.put("orderByType", DataApiUtils.getOrderByType(order));
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), MATERIAL_CLERK_DATA);
if (result.get("data") == null) {
return new Page<>();
}
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(result.get("page")), JSONObject.class);
int totalCount = jsonObject.getIntValue("totalCount");
int totalPage = jsonObject.getIntValue("totalPage");
List<MaterialClerkUsedDataVO> dataVOS = JSON.parseArray(JSON.toJSONString(result.get("data")), MaterialClerkUsedDataVO.class);
Page<MaterialClerkUsedDataVO> pageResult = new Page<>();
pageResult.setTotalCount(totalCount);
pageResult.setTotalPage(totalPage);
pageResult.setCurrentPage(pageNo);
pageResult.setPageSize(pageSize);
pageResult.setResult(dataVOS);
return pageResult;
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_CLERK_DATA);
Page<MaterialClerkUsedDataVO> pageData = DataApiUtils.getPageData(result, MaterialClerkUsedDataVO.class);
return pageData;
}
/**
......@@ -204,40 +187,26 @@ public class MaterialDataAdaptor {
* @param orderStr
* @return
*/
public Page<MaterialStoreUsedDataVO> queryMaterialStoreUsedData(String enterpriseId, List<String> storeIds, Integer fixedDateDiff,
String orderField, String orderStr, Integer pageNo, Integer pageSize) {
Map<String, Object> params = new HashMap<>();
public Page<MaterialStoreUsedDataVO> queryMaterialStoreUsedData(MaterialStoreAnalyzeDataQO dataQO, List<String> storeIds) {
int pageNum = dataQO.getPageNum();
int pageSize = dataQO.getPageSize();
String enterpriseId = dataQO.getEnterpriseId();
Integer fixedDateDiff = dataQO.getFixedDateDiff();
String order = dataQO.getOrder();
String orderByField = dataQO.getOrderByField();
Map<String, Object> inlineParams = new HashMap<>();
params.put("pageNo", pageNo);
params.put("pageSize", pageSize);
params.put("inFields", inlineParams);
inlineParams.put("pageNum", pageNum);
inlineParams.put("pageSize", pageSize);
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("fixedDateDiff", fixedDateDiff);
if (StringUtils.isNotBlank(orderField)) {
inlineParams.put("orderByField", orderField + " " + orderStr);
}else {
inlineParams.put("orderByField", "enterpriseId asc ");
}
inlineParams.put("orderByFields", DataApiUtils.getOrderByFields(orderByField, "enterpriseId", dataQO.getFieldsOrder()));
inlineParams.put("orderByType", DataApiUtils.getOrderByType(order));
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), MATERIAL_STORE_DATA);
if (result.get("data") == null) {
return new Page<>();
}
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(result.get("page")), JSONObject.class);
int totalCount = jsonObject.getIntValue("totalCount");
int totalPage = jsonObject.getIntValue("totalPage");
List<MaterialStoreUsedDataVO> dataVOS = JSON.parseArray(JSON.toJSONString(result.get("data")), MaterialStoreUsedDataVO.class);
Page<MaterialStoreUsedDataVO> pageResult = new Page<>();
pageResult.setTotalCount(totalCount);
pageResult.setTotalPage(totalPage);
pageResult.setCurrentPage(pageNo);
pageResult.setPageSize(pageSize);
pageResult.setResult(dataVOS);
return pageResult;
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_STORE_DATA);
Page<MaterialStoreUsedDataVO> pageData = DataApiUtils.getPageData(result, MaterialStoreUsedDataVO.class);
return pageData;
}
......@@ -255,8 +224,8 @@ public class MaterialDataAdaptor {
Integer pageSize = materialReportQO.getPageSize();
String clerkId = materialReportQO.getClerkId();
String enterpriseId = materialReportQO.getEnterpriseId();
String orderField = materialReportQO.getOrderByField();
String orderStr = materialReportQO.getOrder();
String orderByField = materialReportQO.getOrderByField();
String order = materialReportQO.getOrder();
// 获取当前时间周期
DateTime startTime = null;
DateTime endTime = null;
......@@ -271,11 +240,9 @@ public class MaterialDataAdaptor {
endTime = DateUtil.endOfMonth(DateUtil.lastMonth());
apolloKey = MATERIAL_CLERK_MONTH_DATA;
}
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>();
params.put("pageNo", pageNo);
params.put("pageSize", pageSize);
params.put("inFields", inlineParams);
inlineParams.put("pageNum", pageNo);
inlineParams.put("pageSize", pageSize);
if (StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId);
}
......@@ -284,33 +251,15 @@ public class MaterialDataAdaptor {
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
if (StringUtils.isNotBlank(orderField)) {
inlineParams.put("orderByField", orderField + " " + orderStr);
}else {
inlineParams.put("orderByField", "enterpriseId asc ");
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), apolloKey);
if (result.get("data") == null) {
return new Page<>();
}
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(result.get("page")), JSONObject.class);
int totalCount = jsonObject.getIntValue("totalCount");
int totalPage = jsonObject.getIntValue("totalPage");
Page<MaterialPersonalUsedDataVO> pageResult = new Page<>();
pageResult.setTotalCount(totalCount);
pageResult.setTotalPage(totalPage);
pageResult.setCurrentPage(pageNo);
pageResult.setPageSize(pageSize);
List<MaterialPersonalUsedDataVO> materialPersonalUsedDataVos = JSON.parseArray(JSON.toJSONString(result.get("data")), MaterialPersonalUsedDataVO.class);
if (CollectionUtils.isEmpty(materialPersonalUsedDataVos)) {
return new Page<>();
}
for (MaterialPersonalUsedDataVO materialPersonalUsedDataVo : materialPersonalUsedDataVos) {
inlineParams.put("orderByFields", DataApiUtils.getOrderByFields(orderByField, "enterpriseId", materialReportQO.getFieldsOrder()));
inlineParams.put("orderByType", DataApiUtils.getOrderByType(order));
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
Page<MaterialPersonalUsedDataVO> pageData = DataApiUtils.getPageData(result, MaterialPersonalUsedDataVO.class);
for (MaterialPersonalUsedDataVO materialPersonalUsedDataVo : pageData.getResult()) {
materialPersonalUsedDataVo.setStartTime(startTime);
materialPersonalUsedDataVo.setEndTime(endTime);
}
pageResult.setResult(materialPersonalUsedDataVos);
return pageResult;
return pageData;
}
/**
......@@ -319,14 +268,14 @@ public class MaterialDataAdaptor {
* @param storeIds
* @return
*/
public Page<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(MaterialReportQO materialReportQO, List<String> storeIds) {
public Page<MaterialStoreUsedDataVO> queryMaterialStoreUseReport(MaterialStoreReportQO materialReportQO, List<String> storeIds) {
Integer reportType = materialReportQO.getReportType();
Integer pageNo = materialReportQO.getPageNum();
Integer pageSize = materialReportQO.getPageSize();
String clerkId = materialReportQO.getClerkId();
String enterpriseId = materialReportQO.getEnterpriseId();
String orderField = materialReportQO.getOrderByField();
String orderByField = materialReportQO.getOrderByField();
String order = materialReportQO.getOrder();
// 获取当前时间周期
DateTime startTime = null;
......@@ -342,11 +291,9 @@ public class MaterialDataAdaptor {
endTime = DateUtil.endOfMonth(DateUtil.lastMonth());
apolloKey = MATERIAL_STORE_MONTH_DATA;
}
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>();
params.put("pageNo", pageNo);
params.put("pageSize", pageSize);
params.put("inFields", inlineParams);
inlineParams.put("pageNum", pageNo);
inlineParams.put("pageSize", pageSize);
if (StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId);
}
......@@ -355,18 +302,11 @@ public class MaterialDataAdaptor {
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
if (StringUtils.isNotBlank(orderField)) {
String orderStr = " " + order;
inlineParams.put("orderByField", orderField + orderStr);
}else {
inlineParams.put("orderByField", "enterpriseId asc ");
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), apolloKey);
if (result.get("data") == null) {
return new Page<>();
}
Page<MaterialStoreUsedDataVO> pageResult = new Page<>();
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class);
inlineParams.put("orderByFields", DataApiUtils.getOrderByFields(orderByField, "enterpriseId", materialReportQO.getFieldsOrder()));
inlineParams.put("orderByType", DataApiUtils.getOrderByType(order));
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
Page pageData = DataApiUtils.getPageData(result);
List<JSONObject> jsonObjects = (List<JSONObject>) pageData.getResult();
if (CollectionUtils.isEmpty(jsonObjects)) {
return new Page<>();
}
......@@ -383,15 +323,8 @@ public class MaterialDataAdaptor {
materialStoreUsedDataVO.setStartTime(startTime);
materialStoreUsedDataVO.setEndTime(endTime);
}
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(result.get("page")), JSONObject.class);
int totalCount = jsonObject.getIntValue("totalCount");
int totalPage = jsonObject.getIntValue("totalPage");
pageResult.setTotalCount(totalCount);
pageResult.setTotalPage(totalPage);
pageResult.setCurrentPage(pageNo);
pageResult.setPageSize(pageSize);
pageResult.setResult(materialStoreUsedDataVOS);
return pageResult;
pageData.setResult(materialStoreUsedDataVOS);
return pageData;
}
/**
......@@ -426,9 +359,7 @@ public class MaterialDataAdaptor {
}
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams);
if (StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId);
}
......@@ -437,7 +368,7 @@ public class MaterialDataAdaptor {
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), apolloKey);
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), apolloKey);
if (result.get("data") == null) {
MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO();
materialAreaUsedDataVO.setStartTime(startTime);
......@@ -445,7 +376,7 @@ public class MaterialDataAdaptor {
materialAreaUsedDataVO.setBrandName(enterpriseDTO.getBrandName());
return materialAreaUsedDataVO;
}
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class);
List<JSONObject> jsonObjects = DataApiUtils.getDataList(result);
if (CollectionUtils.isEmpty(jsonObjects)) {
MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO();
materialAreaUsedDataVO.setStartTime(startTime);
......@@ -469,21 +400,6 @@ public class MaterialDataAdaptor {
return materialAreaUsedDataVO;
}
private Map<String, Object> doHttp(String jsonParam, String apolloKey) {
try {
log.info("调用接口 apolloKey:{}, 参数:{}", apolloKey, jsonParam);
Map<String, Object> result = DataTargetHttpUtils.http(jsonParam, apolloKey);
if (result == null) {
return Collections.emptyMap();
}
return result;
} catch (Exception ex) {
log.info("请求接口失败 apolloKey:{}", apolloKey, ex);
}
return Collections.emptyMap();
}
/**
* 会员最近30天的浏览素材数量
*
......@@ -495,19 +411,14 @@ public class MaterialDataAdaptor {
*/
public Map<String, Integer> queryMemberVisitMap(String enterpriseId, String storeId, String clerkId, List<String> memberIds) {
Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams);
if (StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId);
}
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("customerId", StringUtils.join(memberIds, ","));
Map<String, Object> result = this.doHttp(JSON.toJSONString(params), MEMBER_RECENTLY_30_DAY_VISIT);
if (result.get("data") == null) {
return Collections.emptyMap();
}
List<MemberVisitMaterialBO> memberVisitMaterialBos = JSON.parseArray(JSON.toJSONString(result.get("data")), MemberVisitMaterialBO.class);
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MEMBER_RECENTLY_30_DAY_VISIT);
List<MemberVisitMaterialBO> memberVisitMaterialBos = DataApiUtils.parseDataList(result, MemberVisitMaterialBO.class);
if (CollectionUtils.isEmpty(memberVisitMaterialBos)) {
return Collections.emptyMap();
}
......
package com.gic.haoban.manage.web.exception;
import com.gic.commons.exception.DataApiException;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.ShowFrontMessageException;
import com.gic.haoban.common.utils.HaobanResponse;
......@@ -133,4 +134,17 @@ public class GlobalExceptionHandler extends WebBaseController {
public HaobanResponse controllerNoLoginException(HttpServletResponse response, NoLoginException ex) {
return resultResponse(HaoBanErrCode.ERR_4);
}
/**
* 数据组API错误
* @param response
* @param ex
* @return
*/
@ResponseBody
@ExceptionHandler(DataApiException.class)
public HaobanResponse dataApiException(HttpServletResponse response, DataApiException ex) {
logger.info("DataApiException异常信息", ex);
return resultResponse(HaoBanErrCode.ERR_3);
}
}
......@@ -2,6 +2,9 @@ package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author MUSI
* @Date 2023/3/23 1:00 PM
......@@ -30,4 +33,17 @@ public class MaterialAnalyzeDataQO extends MaterialStatisticsBaseQO {
* desc
*/
private String order;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("useMatlDayNum", 11);
map.put("useMatlNum", 12);
map.put("singleMatlAvgCnt", 13);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
}
......@@ -2,6 +2,9 @@ package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author MUSI
* @Date 2023/3/23 12:48 PM
......@@ -38,4 +41,24 @@ public class MaterialReportQO extends MaterialStatisticsBaseQO {
* 业务周期
*/
private String bizDate;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("useMatlNum", 5);
map.put("useMatlNumRank", 6);
map.put("useMatlNumRatio", 7);
map.put("userClickNum", 8);
map.put("userClickNumRatio", 9);
map.put("convUserNum", 10);
map.put("convUserNumRatio", 11);
map.put("convSalesAmt", 12);
map.put("convSalesAmtRank", 13);
map.put("convSalesAmtRatio", 14);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
}
package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author MUSI
* @Date 2023/3/23 1:00 PM
* @Description
* @Version
**/
@Data
public class MaterialStoreAnalyzeDataQO extends MaterialStatisticsBaseQO {
private static final long serialVersionUID = 3422937373665522931L;
/**
* 时间筛选
* 1 过去7天(默认选中),2 过去30天,3 过去60天,4 过去90天,5本周,6 本月,7 上月,8 上上月,9 上上上月
*/
private Integer fixedDateDiff;
/**
* 排序字段
* 日均使用导购占比
* 转化客户数
*/
private String orderByField;
/**
* asc
* desc
*/
private String order;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("dayAvgUseMatlNum", 5);
map.put("dayAvgUseRate", 6);
map.put("clickUserNum", 7);
map.put("convUserNum", 8);
map.put("convSalesNmt", 9);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
}
package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author MUSI
* @Date 2023/3/23 12:48 PM
* @Description
* @Version
* 素材
**/
@Data
public class MaterialStoreReportQO extends MaterialStatisticsBaseQO {
private static final long serialVersionUID = -4105397589798480404L;
/**
* 数据类型
* 1 周报; 2 月报
* @see com.gic.haoban.manage.api.enums.content.MaterialReportType
*/
private Integer reportType;
/**
* 排序字段
* 日均使用导购占比
* 转化客户数
*/
private String orderByField;
/**
* asc
* desc
*/
private String order;
/**
* 业务周期
*/
private String bizDate;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("enterpriseId", 1);
map.put("dayAvgUseMatlNum", 4);
map.put("dayAvgUseMatlNumRatio", 5);
map.put("dayAvgUseBindProportion", 6);
map.put("dayAvgUseBindProportionRatio", 7);
map.put("userClickNum", 8);
map.put("userClickNumRatio", 9);
map.put("convUserNum", 10);
map.put("convUserNumRatio", 11);
map.put("convSalesAmt", 12);
map.put("convSalesAmtRank", 13);
map.put("convSalesAmtRatio", 14);
return map;
}
public String getDefaultFields() {
return "enterpriseId";
}
}
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