Commit 784bab37 by songyinghui

feat: 区经品牌名称

parent e3b55642
...@@ -6,6 +6,8 @@ import cn.hutool.core.date.DateUtil; ...@@ -6,6 +6,8 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
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.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO; import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO;
import com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils; import com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils;
...@@ -19,6 +21,7 @@ import com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUs ...@@ -19,6 +21,7 @@ import com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUs
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Collections; import java.util.Collections;
...@@ -87,6 +90,9 @@ public class MaterialDataAdaptor { ...@@ -87,6 +90,9 @@ public class MaterialDataAdaptor {
*/ */
private static final String MEMBER_RECENTLY_30_DAY_VISIT = "data_matl_haoban_user_30day_stats_real"; private static final String MEMBER_RECENTLY_30_DAY_VISIT = "data_matl_haoban_user_30day_stats_real";
@Autowired
private EnterpriseService enterpriseService;
/** /**
* 查询素材首页使用数据 * 查询素材首页使用数据
...@@ -409,6 +415,17 @@ public class MaterialDataAdaptor { ...@@ -409,6 +415,17 @@ public class MaterialDataAdaptor {
endTime = DateUtil.endOfMonth(DateUtil.lastMonth()); endTime = DateUtil.endOfMonth(DateUtil.lastMonth());
apolloKey = MATERIAL_AREA_MONTH_DATA; apolloKey = MATERIAL_AREA_MONTH_DATA;
} }
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
if (enterpriseDTO == null) {
MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO();
materialAreaUsedDataVO.setStartTime(startTime);
materialAreaUsedDataVO.setEndTime(endTime);
log.info("企业{}不存在", enterpriseId);
return materialAreaUsedDataVO;
}
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
Map<String, Object> inlineParams = new HashMap<>(); Map<String, Object> inlineParams = new HashMap<>();
params.put("inFields", inlineParams); params.put("inFields", inlineParams);
...@@ -425,6 +442,7 @@ public class MaterialDataAdaptor { ...@@ -425,6 +442,7 @@ public class MaterialDataAdaptor {
MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO(); MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO();
materialAreaUsedDataVO.setStartTime(startTime); materialAreaUsedDataVO.setStartTime(startTime);
materialAreaUsedDataVO.setEndTime(endTime); materialAreaUsedDataVO.setEndTime(endTime);
materialAreaUsedDataVO.setBrandName(enterpriseDTO.getBrandName());
return materialAreaUsedDataVO; return materialAreaUsedDataVO;
} }
List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class); List<JSONObject> jsonObjects = JSON.parseArray(JSON.toJSONString(result.get("data")), JSONObject.class);
...@@ -432,6 +450,7 @@ public class MaterialDataAdaptor { ...@@ -432,6 +450,7 @@ public class MaterialDataAdaptor {
MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO(); MaterialAreaUsedDataVO materialAreaUsedDataVO = new MaterialAreaUsedDataVO();
materialAreaUsedDataVO.setStartTime(startTime); materialAreaUsedDataVO.setStartTime(startTime);
materialAreaUsedDataVO.setEndTime(endTime); materialAreaUsedDataVO.setEndTime(endTime);
materialAreaUsedDataVO.setBrandName(enterpriseDTO.getBrandName());
return materialAreaUsedDataVO; return materialAreaUsedDataVO;
} }
List<MaterialAreaUsedDataVO> areaUsedDataVOS = jsonObjects.stream() List<MaterialAreaUsedDataVO> areaUsedDataVOS = jsonObjects.stream()
...@@ -446,6 +465,7 @@ public class MaterialDataAdaptor { ...@@ -446,6 +465,7 @@ public class MaterialDataAdaptor {
MaterialAreaUsedDataVO materialAreaUsedDataVO = areaUsedDataVOS.get(0); MaterialAreaUsedDataVO materialAreaUsedDataVO = areaUsedDataVOS.get(0);
materialAreaUsedDataVO.setStartTime(startTime); materialAreaUsedDataVO.setStartTime(startTime);
materialAreaUsedDataVO.setEndTime(endTime); materialAreaUsedDataVO.setEndTime(endTime);
materialAreaUsedDataVO.setBrandName(enterpriseDTO.getBrandName());
return materialAreaUsedDataVO; return materialAreaUsedDataVO;
} }
......
...@@ -96,4 +96,9 @@ public class MaterialAreaUsedDataVO implements Serializable { ...@@ -96,4 +96,9 @@ public class MaterialAreaUsedDataVO implements Serializable {
* 结束时间 * 结束时间
*/ */
private Date endTime; private Date endTime;
/**
* 品牌名称
*/
private String brandName;
} }
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