Commit 9ac16bb8 by songyinghui

Merge branch 'bugfix_0424' into 'master'

Bugfix 0424

See merge request !1205
parents 720c1b9f 7f6227f1
...@@ -197,7 +197,8 @@ public class MaterialReportBuilder { ...@@ -197,7 +197,8 @@ public class MaterialReportBuilder {
articleInfo.setAppid(config.getAppid()); articleInfo.setAppid(config.getAppid());
articleInfo.setTitle(context.getMessageTitle()); articleInfo.setTitle(context.getMessageTitle());
articleInfo.setDescription(context.getMessageDesc()); articleInfo.setDescription(context.getMessageDesc());
articleInfo.setPagepath(NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, context.extendParams(context.getMainStoreId()))); String extendParams = StringUtils.isNotBlank(context.getMainStoreId()) ? context.getMainStoreId() : context.getEnterpriseId();
articleInfo.setPagepath(NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, context.extendParams(extendParams)));
articleInfo.setPicurl(context.getMaterialReportUrl()); articleInfo.setPicurl(context.getMaterialReportUrl());
newsSendMessage.setArticleMessages(Collections.singletonList(articleInfo)); newsSendMessage.setArticleMessages(Collections.singletonList(articleInfo));
return newsSendMessage; return newsSendMessage;
......
...@@ -110,14 +110,14 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic ...@@ -110,14 +110,14 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
*/ */
@Override @Override
public ServiceResponse<Void> handlerMaterialWeekReport(String params) { public ServiceResponse<Void> handlerMaterialWeekReport(String params) {
log.info("handlerMaterialWeekReport 执行素材周报任务开始 >>>>> {}", DateUtil.datetimeToString(new Date())); log.info("handlerMaterialWeekReport 执行素材周报任务开始 >>>>> params:{} date: {}", params, DateUtil.datetimeToString(new Date()));
Date now = new Date(); Date now = new Date();
Week week = cn.hutool.core.date.DateUtil.dayOfWeekEnum(now); Week week = cn.hutool.core.date.DateUtil.dayOfWeekEnum(now);
if (!Week.MONDAY.equals(week)) { if (!Week.MONDAY.equals(week)) {
log.info("handlerMaterialWeekReport 当前时间 不是周一 忽略 》》》 {}", DateUtil.datetimeToString(new Date())); log.info("handlerMaterialWeekReport 当前时间 不是周一 忽略 》》》 params:{}, date:{}", params, DateUtil.datetimeToString(new Date()));
return ServiceResponse.success(); return ServiceResponse.success();
} }
return doHandlerReportInner(MaterialReportType.WEEK.getCode()); return doHandlerReportInner(MaterialReportType.WEEK.getCode(), params);
} }
/** /**
...@@ -129,7 +129,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic ...@@ -129,7 +129,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
@Override @Override
public ServiceResponse<Void> handlerMaterialMonthReport(String params) { public ServiceResponse<Void> handlerMaterialMonthReport(String params) {
log.info("handlerMaterialWeekReport 执行素材月报任务开始 >>>>> {}", DateUtil.datetimeToString(new Date())); log.info("handlerMaterialWeekReport 执行素材月报任务开始 >>>>> {}", DateUtil.datetimeToString(new Date()));
return doHandlerReportInner(MaterialReportType.MONTH.getCode()); return doHandlerReportInner(MaterialReportType.MONTH.getCode(), params);
} }
/** /**
...@@ -138,13 +138,20 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic ...@@ -138,13 +138,20 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
* @param reportType * @param reportType
* @return * @return
*/ */
private ServiceResponse<Void> doHandlerReportInner(Integer reportType) { private ServiceResponse<Void> doHandlerReportInner(Integer reportType, String params) {
List<String> enterpriseIds = groupMessageService.hasMaterialRightEnterprise(MaterialEnterpriseAdaptor.MaterialLevel.LOW.getCode()); List<String> enterpriseIds = groupMessageService.hasMaterialRightEnterprise(MaterialEnterpriseAdaptor.MaterialLevel.LOW.getCode());
if (CollectionUtils.isEmpty(enterpriseIds)) { if (CollectionUtils.isEmpty(enterpriseIds)) {
return ServiceResponse.success(); return ServiceResponse.success();
} }
for (String enterpriseId : enterpriseIds) { for (String enterpriseId : enterpriseIds) {
if (StringUtils.isNotBlank(params) && !StringUtils.equals("-1", params)) {
log.info("执行指定企业的数据 {}", params);
if (!StringUtils.equals(params, enterpriseId)) {
log.info("企业{}非目标企业,忽略", enterpriseId);
continue;
}
}
List<String> wxEnterpriseIds = wxEnterpriseService.queryWxEnterpriseWithEnterpriseId(enterpriseId); List<String> wxEnterpriseIds = wxEnterpriseService.queryWxEnterpriseWithEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(wxEnterpriseIds)) { if (CollectionUtils.isEmpty(wxEnterpriseIds)) {
log.info("企业 {}未关联企微", enterpriseId); log.info("企业 {}未关联企微", enterpriseId);
......
...@@ -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