Commit 11b0d752 by songyinghui

feat: 周报月报后门

parent 784bab37
...@@ -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);
......
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