Commit 8e530458 by 王祖波

Merge branch 'feature-2025-cms' into 'master'

Feature 2025 cms

See merge request !2534
parents a0a3045f a0ded935
......@@ -95,10 +95,9 @@ public enum NoticeMessageTypeEnum {
POTENTIAL_CUSTOMER_NOTIFY(6003, "销售线索通知", NoticeMessageCategoryTypeEnum.POTENTIAL_CUSTOMER.getType(), "potential_customer_notify", "/pages/route/index?pageType=", "hbapp_sales_clue_center", "salesLeadNotice", "haobanNotice"),
MATERIAL_REPORT_NOTIFY_MONTH(6004, "素材月报通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_month_notify", "/pages/route/index?pageType=", "hbapp_mate_report", "materialMonth", "clerkMaterialsReport"),
CLERK_COMMISSION_NOTIFY(6005, "客户下单通知", NoticeMessageCategoryTypeEnum.CUSTOMER.getType(), "clerk_commission_notify", "/pages/route/index?pageType=", "hbapp_withdraw_list", "clerkCommissionNotify", "haobanNotice"),
MATERIAL_AUDIT_NOTIFY(6006, "素材审核通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_audit_notify", "/pages/route/index?pageType=", "hbapp_create_center", "materialAuditNotify", "haobanNotice"),
KNOWLEDGE_NEW_NOTIFY(6007, "知识库上新通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "knowledge_new_notify", "/pages/route/index?pageType=", "hbapp_guide_knowledge", "knowledgeNewNotify", "clerkMaterialsNotice"),
APPOINT_MATERIAL_NEW_NOTIFY(6008, "素材上新通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "appoint_material_new_notify", "/pages/route/index?pageType=", "hbapp_material_notice", "appointMaterialsNotice", "clerkMaterialsNotice"),
CASH_APPLY_REFUSE_NOTIFY(7001,"提现通知", NoticeMessageCategoryTypeEnum.OTHER.getType(),"cash_apply_refuse_notify","/pages/route/index?pageType=","hbapp_withdraw_list","cashApplyRefuseNotify","haobanNotice"),
......@@ -107,7 +106,9 @@ public enum NoticeMessageTypeEnum {
CASH_APPLY_OFFLINE_SUCCESS_NOTIFY(7003,"提现通知", NoticeMessageCategoryTypeEnum.OTHER.getType(),"cash_apply_offline_success_notify","/pages/route/index?pageType=","hbapp_withdraw_list","cashApplyOfflineSuccessNotify","haobanNotice"),
AUTHORIZED_LOGIN_NOTIFY(8001,"账号授权通知", NoticeMessageCategoryTypeEnum.AUTHORIZED.getType(),"authorized_login_notify","/pages/route/index?pageType=","hbapp_video_auth","authorizedLoginNotify","haobanNotice"),
AUTHORIZED_LOGOUT_NOTIFY(8002,"账号异常退出登录通知", NoticeMessageCategoryTypeEnum.AUTHORIZED.getType(),"authorized_logout_notify","/pages/route/index?pageType=","hbapp_video_auth","authorizedLogoutNotify","haobanNotice");
AUTHORIZED_LOGOUT_NOTIFY(8002,"账号异常退出登录通知", NoticeMessageCategoryTypeEnum.AUTHORIZED.getType(),"authorized_logout_notify","/pages/route/index?pageType=","hbapp_video_auth","authorizedLogoutNotify","haobanNotice"),
DATA_EXPORT_NOTIFY(9001,"数据导出通知", NoticeMessageCategoryTypeEnum.OTHER.getType(),"data_export_notify","/pages/route/index?pageType=","hbapp_data_export","dataExportNotify","haobanNotice");
/**
* 消息类型
......
package com.gic.haoban.manage.api.util.notify;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO;
......@@ -13,9 +14,7 @@ import org.slf4j.Logger;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
import static org.slf4j.LoggerFactory.getLogger;
......@@ -147,6 +146,15 @@ public class NoticeMessageUtil {
}
}
public static void sendDataExportNotify(String enterpriseId, String clerkId, String taskName, Date exportTime) {
Map<String, String> contentMap = new HashMap<String, String>();
contentMap.put("taskName", taskName);
contentMap.put("exportTime", DateUtil.formatDateTime(exportTime));
Map<String, Object> extendContent = new HashMap<>();
NoticeMessageUtil.sendNoticeMessage(enterpriseId,clerkId,NoticeMessageTypeEnum.DATA_EXPORT_NOTIFY.getType(),null,
contentMap,extendContent);
}
/**
* 构建小程序跳转url
* @param messageTypeEnum
......
package com.gic.haoban.manage.service.pojo.bo.content;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
......@@ -11,6 +13,8 @@ import java.io.Serializable;
* @Version
**/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PotentialCustomerStaticsBO implements Serializable {
/**
......
......@@ -279,15 +279,19 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
log.info("处理企业{}下的销售线索通知", context.getEnterpriseId());
// 根据企业id + 时间 循环查询时间段内的有新互动记录的导购id 去重
InteractRecordQO searchQo = new InteractRecordQO();
searchQo.setEnterpriseId(context.getEnterpriseId());
searchQo.setStartTime(context.getStartTime());
searchQo.setEndTime(context.getEndTime());
List<PotentialCustomerStaticsBO> customerStaticsBos = interactRecordService.staticsClerkNewInteractRecord(searchQo);
List<PotentialCustomerStaticsBO> customerStaticsBos = context.getCustomerStaticsBos();
if (CollectionUtils.isEmpty(customerStaticsBos)) {
log.info("企业下不存在新增线索的导购 {}", JSON.toJSONString(context));
return;
// 根据企业id + 时间 循环查询时间段内的有新互动记录的导购id 去重
InteractRecordQO searchQo = new InteractRecordQO();
searchQo.setEnterpriseId(context.getEnterpriseId());
searchQo.setStartTime(context.getStartTime());
searchQo.setEndTime(context.getEndTime());
customerStaticsBos = interactRecordService.staticsClerkNewInteractRecord(searchQo);
if (CollectionUtils.isEmpty(customerStaticsBos)) {
log.info("企业下不存在新增线索的导购 {}", JSON.toJSONString(context));
return;
}
}
context.setCustomerStaticsBos(customerStaticsBos);
// 获取导购与成员关联关联关系
......
package com.gic.haoban.manage.service.service.content.message;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.content.api.dto.setting.ContentSettingDTO;
import com.gic.content.api.service.ContentSettingApiService;
import com.gic.haoban.manage.api.enums.content.MaterialInteractRecordEventType;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordExtendInfoBO;
import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO;
import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerStaticsBO;
import com.gic.haoban.manage.service.pojo.bo.content.context.InteractRecordMessageContext;
import com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNotifyContext;
import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO;
import com.gic.haoban.manage.service.service.content.InteractRecordService;
import com.gic.haoban.manage.service.service.content.PotentialCustomerService;
import com.gic.haoban.manage.service.service.content.adaptor.InteractRecordMessageBuilder;
import com.gic.haoban.manage.service.util.IntervalUtils;
import com.gic.redis.data.util.RedisUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,6 +44,8 @@ public class InteractRecordMessageService {
InteractRecordMessageBuilder interactRecordMessageBuilder;
@Autowired
PotentialCustomerService potentialCustomerService;
@Autowired
ContentSettingApiService contentSettingApiService;
/**
* 处理互动记录
......@@ -156,6 +165,21 @@ public class InteractRecordMessageService {
potentialCustomerBO.setTimes(interactRecordBO.getTimes());
potentialCustomerService.saveOrUpdatePotentialCustomer(potentialCustomerBO);
}
ServiceResponse<ContentSettingDTO> response = contentSettingApiService.queryContentSettingInfo(interactRecordMessageBO.getEnterpriseId());
if (response.isSuccess() && response.getResult() != null) {
Integer potentialNotifyInterval = response.getResult().getPotentialNotifyInterval();
if (potentialNotifyInterval != null && potentialNotifyInterval <= 0) {
PotentialCustomerNotifyContext notifyContext = PotentialCustomerNotifyContext.builder()
.enterpriseId(interactRecordMessageBO.getEnterpriseId())
.customerStaticsBos(Lists.newArrayList(new PotentialCustomerStaticsBO(interactRecordBO.getClerkId(), 1)))
.build();
// 立即触发场景限制发送频率
boolean send = IntervalUtils.tryAddInterval(interactRecordBO.getClerkId(), interactRecordBO.getMemberId(), interactRecordBO.getUnionId());
if (send) {
potentialCustomerService.sendPotentialCustomerNotice(notifyContext);
}
}
}
}finally {
RedisUtil.unlock(recordKey);
}
......
......@@ -3,6 +3,8 @@ package com.gic.haoban.manage.service.service.message;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.message.center.api.subscribe.model.NoticeMessageForm;
import com.gic.mq.sdk.GicMQClient;
import org.slf4j.Logger;
......@@ -11,6 +13,9 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static org.slf4j.LoggerFactory.getLogger;
......
......@@ -14,6 +14,8 @@ import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.content.api.dto.setting.ContentSettingDTO;
import com.gic.content.api.service.ContentSettingApiService;
import com.gic.enterprise.api.constant.EnterpriseServiceEnum;
import com.gic.enterprise.api.dto.enterprise.EnterpriseUsingStatusDTO;
import com.gic.enterprise.api.service.EnterpriseUseForbidService;
......@@ -82,6 +84,8 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
private WxEnterpriseService wxEnterpriseService;
@Autowired
private PotentialCustomerService potentialCustomerService;
@Autowired
private ContentSettingApiService contentSettingApiService;
@Autowired
private EcommerceOrderOutputApiService ecommerceOrderOutputApiService;
......@@ -267,7 +271,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
*/
@Override
public ServiceResponse<Void> potentialCustomerJob(String params) {
Date now = new Date();
Date now = cn.hutool.core.date.DateUtil.beginOfSecond(cn.hutool.core.date.DateUtil.date());
log.info("potentialCustomerJob 执行销售线索通知 {}", cn.hutool.core.date.DateUtil.format(now, "yyyy-MM-dd HH:mm:ss"));
int currentHour = cn.hutool.core.date.DateUtil.hour(now, true);
if (currentHour >= 23 || currentHour < 8) {
......@@ -279,7 +283,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
log.info("开通内容权限的企业为空");
return ServiceResponse.success();
}
Date startTime = cn.hutool.core.date.DateUtil.offsetMinute(now, -30).toJdkDate();
Date startTime = null;
// 如果是8点那次的执行 需要获取 23 ~ 8点的数据
if (checkIsTodayFirst(now)) {
log.info("本次执行为当天第一次执行 {}", cn.hutool.core.date.DateUtil.format(now, "yyyy-MM-dd HH:mm:ss"));
......@@ -294,6 +298,18 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
startTime = calendar.getTime();
}
for (String enterpriseId : enterpriseIds) {
Integer potentialNotifyInterval = 30;
ServiceResponse<ContentSettingDTO> response = contentSettingApiService.queryContentSettingInfo(enterpriseId);
if (response.isSuccess() && response.getResult() != null) {
potentialNotifyInterval = response.getResult().getPotentialNotifyInterval();
}
if (potentialNotifyInterval <= 0 || cn.hutool.core.date.DateUtil.minute(now) % potentialNotifyInterval != 0) {
continue;
}
if (startTime == null) {
startTime = cn.hutool.core.date.DateUtil.offsetMinute(now, -potentialNotifyInterval).toJdkDate();
}
log.info("销售线索执行eid:{},potentialNotifyInterval:{}", enterpriseId, potentialNotifyInterval);
PotentialCustomerNotifyContext context = PotentialCustomerNotifyContext.builder()
.enterpriseId(enterpriseId)
.startTime(startTime)
......@@ -314,8 +330,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
int hour_sec = 30 * 60;
private boolean checkIsTodayFirst(Date now) {
DateTime temp = cn.hutool.core.date.DateUtil.offsetSecond(now, -(hour_sec));
return cn.hutool.core.date.DateUtil.hour(temp, true) < 8;
return cn.hutool.core.date.DateUtil.hour(now, true) == 8 && cn.hutool.core.date.DateUtil.minute(now) < 5;
}
......
package com.gic.haoban.manage.service.util;
import com.gic.redis.data.util.RedisUtil;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import java.util.concurrent.TimeUnit;
/**
* Created by wangzubo on 2025/3/5.
*/
public class IntervalUtils {
private static final String INTERVAL_KEY = "haoban-manage3-service:interval_potential:%s:%s:%s";
public static boolean tryAddInterval(String clerkId,String memberId,String unionId) {
String key = String.format(INTERVAL_KEY, clerkId, memberId, unionId);
RedissonClient redisClient = RedisUtil.getRedisClient();
RBucket<Object> bucket = redisClient.getBucket(key);
boolean trySet = bucket.trySet(1, 10, TimeUnit.SECONDS);
if (!trySet) {
return false;
}
return true;
}
}
......@@ -10,6 +10,7 @@ import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.CheckQywxSettingApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.dto.qdto.group.QywxGroupMessageQDTO;
......@@ -79,7 +80,7 @@ public class NotityTest {
@Test
public void test2() {
NoticeMessageUtil.sendDataExportNotify("ff8080815dacd3a2015dacd3ef5c0000", "26efaa8144e14f60b2f4d48ffe9f708c", "导出测试", DateUtil.date());
}
......
......@@ -123,6 +123,9 @@ public class ContentAccountController {
accountGenerateQrCodeQDTO.setBizType(accountGenerateQrCodeQo.getBizType());
ServiceResponse<AccountAuthorizeDTO> serviceResponse = contentAccountApiService.generateQrCode(accountGenerateQrCodeQDTO);
if (!serviceResponse.isSuccess()) {
if (Objects.equals(serviceResponse.getCode(), "600")) {
return RestResponse.failure("600", "正在授权中的账号有点多,请稍后重试");
}
return RestResponse.failure("500", "生成二维码异常");
}
return RestResponse.successResult(EntityUtil.changeEntityByJSON(AccountAuthorizeVo.class, serviceResponse.getResult()));
......
......@@ -90,6 +90,7 @@ public class ContentCreativeController {
if (clerk == null) {
return RestResponse.failure("-1", "导购不存在");
}
Long clerkTaskPlanId = saveQO.getClerkTaskPlanId() ;
//组装导购发布人信息
ContentProducerClerkRandomQDTO producerQDTO = new ContentProducerClerkRandomQDTO();
producerQDTO.setProducerType(MaterialProducerTypeEnum.CLERK.value);
......@@ -112,11 +113,11 @@ public class ContentCreativeController {
contentMaterialQDTO.setMaterialPurpose(MaterialPurposeEnum.AUDIT.code);
contentMaterialQDTO.setPublishType(MaterialPublishTypeEnum.NONE.value);
contentMaterialQDTO.setShelfStatus(Constant.FLAG_TRUE);
contentMaterialQDTO.setMaterialBusiSource(clerkTaskPlanId != null ? MaterialBusiSourceEnum.CLERK_TASK.code : MaterialBusiSourceEnum.ACTIVE.code);
ServiceResponse<ContentMaterialDTO> response = contentMaterialApiService.saveMaterial(contentMaterialQDTO);
if (!response.isSuccess()) {
return RestResponse.failure(response.getCode(), response.getMessage());
}
Long clerkTaskPlanId = saveQO.getClerkTaskPlanId() ;
if(null != clerkTaskPlanId) {
ClerkTaskContentLogDTO dto = new ClerkTaskContentLogDTO() ;
dto.setPlanId(clerkTaskPlanId);
......
......@@ -122,6 +122,7 @@ public class ContentMaterialController {
pageQDTO.setMaterialType(contentMaterialQO.getMaterialType());
pageQDTO.setClerkId(contentMaterialQO.getClerkId());
pageQDTO.setGoodsId(contentMaterialQO.getGoodsId());
pageQDTO.setContentMaterialIdList(contentMaterialQO.getContentMaterialIdList());
if (contentMaterialQO.getSortType() != null) {
if (contentMaterialQO.getSortType() == 2) {
......
......@@ -2,15 +2,18 @@ package com.gic.haoban.manage.web.controller.content;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.*;
import com.gic.clerk.api.dto.AuthorizedUser;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.burypoint.ContentMemberBuryPointDTO;
import com.gic.content.api.dto.material.ContentMaterialDTO;
import com.gic.content.api.dto.material.ContentMaterialFrontDTO;
import com.gic.content.api.enums.MaterialSearchSceneEnum;
import com.gic.content.api.qdto.burypoint.ContentMemberBuryPointQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageQDTO;
import com.gic.content.api.service.ContentMaterialApiService;
......@@ -19,33 +22,30 @@ import com.gic.enterprise.api.service.StoreService;
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.export.ContentMaterialClerkUsedDataHandler;
import com.gic.haoban.manage.web.export.ContentMaterialStoreUsedDataHandler;
import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO;
import com.gic.haoban.manage.web.qo.content.statistics.*;
import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils;
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;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialIndexDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialRealDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialStoreUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.*;
import com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO;
import com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO;
import com.gic.qcloud.BucketNameEnum;
import com.gic.web.common.download.DownloadTask;
import com.gic.web.common.download.DownloadTaskUtil;
import com.gic.web.common.download.constants.TaskTypeEnum;
import com.gic.web.common.utils.SessionContextUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -66,6 +66,10 @@ public class MaterialDataStaticsController {
private ClerkService clerkService;
@Autowired
private StoreService storeService;
@Autowired
private ContentMaterialClerkUsedDataHandler materialClerkUsedDataHandler;
@Autowired
private ContentMaterialStoreUsedDataHandler materialStoreUsedDataHandler;
/**
* 获取素材首页数据
......@@ -148,6 +152,25 @@ public class MaterialDataStaticsController {
}
/**
* 素材使用分析页面-实时数据统计-详情
* @param materialStatisticsBaseQO
* @return
*/
@RequestMapping(path = "/content/material/real/detail/data")
public RestResponse<Page<MaterialRealDetailDataVO>> queryMaterialTodayDataDetail(@RequestBody MaterialTodayDetailDataQO materialStatisticsBaseQO) {
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
Page<MaterialRealDetailDataVO> page = materialDataAdaptor.queryMaterialTodayDataDetail(materialStatisticsBaseQO, storeIds);
return RestResponse.successResult(page);
}
/**
* 素材使用分析页面-数据概览
*
* @param materialStatisticsBaseQO
......@@ -189,6 +212,53 @@ public class MaterialDataStaticsController {
}
/**
* 素材使用分析页面-导购纬度使用数据 导出
* @param materialStatisticsBaseQO
* @return
*/
@ResponseBody
@RequestMapping(value = "/content/material/clerk/data/export")
public RestResponse<Object> queryMaterialClerkUsedDataExport(@RequestBody MaterialAnalyzeDataQO materialStatisticsBaseQO) {
ClerkDTO clerkDTO = clerkService.getclerkById(materialStatisticsBaseQO.getClerkId());
if (clerkDTO == null) {
return RestResponse.failure("-1","导购不存在");
}
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
materialStatisticsBaseQO.setStoreIdList(storeIds);
materialStatisticsBaseQO.setPageNum(1);
materialStatisticsBaseQO.setPageSize(1);
Page<MaterialClerkUsedDataVO> clerkUsedData = materialDataAdaptor.queryMaterialClerkUsedData(materialStatisticsBaseQO,storeIds);
int total = clerkUsedData.getTotalCount();
if (total <= 0) {
return RestResponse.failure("-1","无导出数据");
}
AuthorizedUser user = new AuthorizedUser();
user.setUserId(clerkDTO.getClerkId());
user.setEnterpriseId(clerkDTO.getEnterpriseId());
user.setRealName(clerkDTO.getClerkName());
DownloadTask task = new DownloadTask();
task.setTaskTypeEnum(TaskTypeEnum.CONTENT_USED_DOWNLOAD);
task.setDataType(1);
task.setUser(user);
task.setTotalCount(total);
String fileName = "素材-" + materialStatisticsBaseQO.getMallDesc() + "导购数据导出";
task.setFileName(fileName);
task.setProjectCode("haoban_new");
task.setChannelName("好办-素材导购数据");
task.setBucketName(BucketNameEnum.REPORT_50000.getName());
task.setSearchDataParams(JSONObject.toJSONString(materialStatisticsBaseQO));
task.setHandler(materialClerkUsedDataHandler);
JSONResponse downloadTask = DownloadTaskUtil.createDownloadTask(task);
return RestResponse.successResult(downloadTask.getResult());
}
/**
* 素材使用分析页面-门店纬度使用数据
*
* @return
......@@ -203,28 +273,56 @@ public class MaterialDataStaticsController {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO,storeIds);
if (CollectionUtils.isNotEmpty(storeUsedData.getResult())) {
List<String> tempStoreIds = storeUsedData.getResult()
.stream()
.map(MaterialStoreUsedDataVO::getStoreId)
.collect(Collectors.toList());
String[] storeIdsArry = new String[tempStoreIds.size()];
List<StoreDTO> storeDTOS = storeService.getStores(tempStoreIds.toArray(storeIdsArry));
if (CollectionUtils.isNotEmpty(storeDTOS)) {
Map<String, StoreDTO> storeInfoMap = storeDTOS.stream()
.collect(Collectors.toMap(StoreDTO::getStoreId, Function.identity(), (v1, v2) -> v1));
for (MaterialStoreUsedDataVO materialStoreUsedDataVO : storeUsedData.getResult()) {
StoreDTO storeDTO = storeInfoMap.get(materialStoreUsedDataVO.getStoreId());
if (storeDTO != null) {
materialStoreUsedDataVO.setStoreName(storeDTO.getStoreName());
materialStoreUsedDataVO.setStoreCode(storeDTO.getStoreCode());
}
}
}
}
return RestResponse.successResult(storeUsedData);
}
/**
* 素材使用分析页面-门店纬度使用数据 导出
* @param materialStatisticsBaseQO
* @return
*/
@ResponseBody
@RequestMapping(value = "/content/material/store/data/export")
public RestResponse<Object> queryMaterialStoreUsedDataExport(@RequestBody MaterialStoreAnalyzeDataQO materialStatisticsBaseQO) {
ClerkDTO clerkDTO = clerkService.getclerkById(materialStatisticsBaseQO.getClerkId());
if (clerkDTO == null) {
return RestResponse.failure("-1","导购不存在");
}
List<String> storeIds = new ArrayList<>();
if (StringUtils.isBlank(materialStatisticsBaseQO.getStoreId())) {
storeIds = clerkStoreAdaptor.queryClerkStoreIds(materialStatisticsBaseQO.getClerkId(), materialStatisticsBaseQO.getWxEnterpriseId(),
StoreStatusFilterUtils.getStoreStatusList(materialStatisticsBaseQO.getStoreStatusFilter()));
} else {
storeIds.add(materialStatisticsBaseQO.getStoreId());
}
materialStatisticsBaseQO.setStoreIdList(storeIds);
materialStatisticsBaseQO.setPageNum(1);
materialStatisticsBaseQO.setPageSize(1);
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO, storeIds);
int total = storeUsedData.getTotalCount();
if (total <= 0) {
return RestResponse.failure("-1","无导出数据");
}
AuthorizedUser user = new AuthorizedUser();
user.setUserId(clerkDTO.getClerkId());
user.setEnterpriseId(clerkDTO.getEnterpriseId());
user.setRealName(clerkDTO.getClerkName());
String fileName = "素材-" + materialStatisticsBaseQO.getMallDesc() + "门店数据导出";
DownloadTask task = new DownloadTask();
task.setTaskTypeEnum(TaskTypeEnum.CONTENT_USED_DOWNLOAD);
task.setDataType(1);
task.setUser(user);
task.setTotalCount(total);
task.setFileName(fileName);
task.setProjectCode("haoban_new");
task.setChannelName("好办-素材门店数据");
task.setBucketName(BucketNameEnum.REPORT_50000.getName());
task.setSearchDataParams(JSONObject.toJSONString(materialStatisticsBaseQO));
task.setHandler(materialStoreUsedDataHandler);
JSONResponse downloadTask = DownloadTaskUtil.createDownloadTask(task);
return RestResponse.successResult(downloadTask.getResult());
}
// 导购 周报/月报数据
......
package com.gic.haoban.manage.web.controller.content.adaptor;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.dto.StoreInfoDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
......@@ -17,6 +20,8 @@ import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author MUSI
......@@ -34,6 +39,8 @@ public class ClerkStoreAdaptor {
private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private StoreService storeService;
/**
* 查询区经角色下管辖的门店权限
......@@ -99,4 +106,26 @@ public class ClerkStoreAdaptor {
return clerkDTOS;
}
public Map<String, ClerkDTO> queryClerkMap(List<String> clerkIds) {
if (CollectionUtils.isEmpty(clerkIds)) {
return Collections.emptyMap();
}
List<ClerkDTO> clerkDTOS = queryClerkInfos(clerkIds);
if (CollectionUtils.isEmpty(clerkDTOS)) {
return Collections.emptyMap();
}
return clerkDTOS.stream().collect(Collectors.toMap(ClerkDTO::getClerkId, clerkDTO -> clerkDTO));
}
public Map<String, StoreDTO> queryStoreMap(List<String> storeIds) {
if (CollectionUtils.isEmpty(storeIds)) {
return Collections.emptyMap();
}
String[] storeIdsArry = new String[storeIds.size()];
List<StoreDTO> storeDTOS = storeService.getStores(storeIds.toArray(storeIdsArry));
if (CollectionUtils.isEmpty(storeDTOS)) {
return Collections.emptyMap();
}
return storeDTOS.stream().collect(Collectors.toMap(StoreDTO::getStoreId, storeDTO -> storeDTO));
}
}
......@@ -7,14 +7,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.commons.util.DataApiUtils;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.StoreService;
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.qo.content.statistics.*;
import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialConvsVO;
import com.gic.haoban.manage.web.vo.content.statistics.*;
import com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO;
......@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
......@@ -105,6 +106,10 @@ public class MaterialDataAdaptor {
@Autowired
private EnterpriseService enterpriseService;
@Autowired
private StoreService storeService;
@Autowired
private ClerkStoreAdaptor clerkStoreAdaptor;
/**
......@@ -116,6 +121,7 @@ public class MaterialDataAdaptor {
public MaterialTodayDataBO queryMaterialTodayData(String enterpriseId, List<String> storeIds) {
Map<String, Object> inlineParams = new HashMap<>();
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("dataType", 1);
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
......@@ -123,7 +129,7 @@ public class MaterialDataAdaptor {
if (result.get("data") == null) {
return MaterialTodayDataBO.empty();
}
List<MaterialTodayDataBO> datas = DataApiUtils.parseDataList(result, MaterialTodayDataBO.class);
List<MaterialTodayDataBO> datas = DataApiUtils.parsePageDataList(result, MaterialTodayDataBO.class);
if (CollectionUtils.isEmpty(datas)) {
return MaterialTodayDataBO.empty();
}
......@@ -158,6 +164,60 @@ public class MaterialDataAdaptor {
return datas.get(0);
}
/**
* 查询当天数据明细
* @param dataQO
* @param storeIds
* @return
*/
public Page<MaterialRealDetailDataVO> queryMaterialTodayDataDetail(MaterialTodayDetailDataQO dataQO, List<String> storeIds) {
int pageNum = dataQO.getPageNum();
int pageSize = dataQO.getPageSize();
String enterpriseId = dataQO.getEnterpriseId();
String order = dataQO.getOrder();
Map<String, Object> inlineParams = new HashMap<>();
inlineParams.put("pageNum", pageNum);
inlineParams.put("pageSize", pageSize);
inlineParams.put("enterpriseId", enterpriseId);
int orderByFields = DataApiUtils.getOrderByFields(dataQO.getOrderByField(), dataQO.getDefaultFields(), dataQO.getFieldsOrder());
inlineParams.put("orderByFields", orderByFields);
inlineParams.put("orderByType", DataApiUtils.getOrderByType(order));
inlineParams.put("dataType", dataQO.getDataType());
if (CollectionUtil.isNotEmpty(storeIds)) {
inlineParams.put("storeId", StringUtils.join(storeIds, ","));
}
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_INDEX_DATA);
Page<MaterialRealDetailDataVO> pageData = DataApiUtils.getPageData(result, MaterialRealDetailDataVO.class);
if (CollectionUtils.isEmpty(pageData.getResult())) {
return pageData;
}
List<String> clerkIdList = new ArrayList<>();
List<String> storeIdList = new ArrayList<>();
pageData.getResult().forEach(item -> {
Optional.ofNullable(item.getClerkId()).ifPresent(clerkIdList::add);
Optional.ofNullable(item.getStoreId()).ifPresent(storeIdList::add);
});
Map<String, ClerkDTO> clerkMap = new HashMap<>();
Map<String, StoreDTO> storeMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(clerkIdList)) {
clerkMap = clerkStoreAdaptor.queryClerkMap(clerkIdList);
}
if (CollectionUtils.isNotEmpty(storeIdList)) {
storeMap = clerkStoreAdaptor.queryStoreMap(storeIdList);
}
for (MaterialRealDetailDataVO item : pageData.getResult()) {
Optional.ofNullable(clerkMap.get(item.getClerkId())).ifPresent(clerk -> {
item.setClerkCode(clerk.getClerkCode());
item.setClerkName(clerk.getClerkName());
});
Optional.ofNullable(storeMap.get(item.getStoreId())).ifPresent(store -> {
item.setStoreCode(store.getStoreCode());
item.setStoreName(store.getStoreName());
});
}
return pageData;
}
/**
* 导购纬度数据统计
......@@ -217,6 +277,25 @@ public class MaterialDataAdaptor {
}
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_STORE_DATA);
Page<MaterialStoreUsedDataVO> pageData = DataApiUtils.getPageData(result, MaterialStoreUsedDataVO.class);
if (CollectionUtils.isNotEmpty(pageData.getResult())) {
List<String> tempStoreIds = pageData.getResult()
.stream()
.map(MaterialStoreUsedDataVO::getStoreId)
.collect(Collectors.toList());
String[] storeIdsArry = new String[tempStoreIds.size()];
List<StoreDTO> storeDTOS = storeService.getStores(tempStoreIds.toArray(storeIdsArry));
if (CollectionUtils.isNotEmpty(storeDTOS)) {
Map<String, StoreDTO> storeInfoMap = storeDTOS.stream()
.collect(Collectors.toMap(StoreDTO::getStoreId, Function.identity(), (v1, v2) -> v1));
for (MaterialStoreUsedDataVO materialStoreUsedDataVO : pageData.getResult()) {
StoreDTO storeDTO = storeInfoMap.get(materialStoreUsedDataVO.getStoreId());
if (storeDTO != null) {
materialStoreUsedDataVO.setStoreName(storeDTO.getStoreName());
materialStoreUsedDataVO.setStoreCode(storeDTO.getStoreCode());
}
}
}
}
return pageData;
}
......
package com.gic.haoban.manage.web.controller.data;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.DownloadReportQDTQ;
import com.gic.enterprise.api.dto.security.DownloadReportDTO;
import com.gic.enterprise.api.service.DownloadReportService;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.web.qo.data.DataExportListQO;
import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialVO;
import com.gic.marketing.pro.api.dto.clerktask.ClerkTaskPlanDTO;
import com.gic.marketing.pro.api.qdto.clerktask.ClerkTaskPageQDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 数据导出
*/
@Controller
@RequestMapping("data/export")
public class DataExportController {
private static Logger logger = LoggerFactory.getLogger(DataExportController.class);
@Autowired
private DownloadReportService downloadReportService ;
/**
* 数据导出列表
*/
@RequestMapping("page-data-export")
@ResponseBody
public RestResponse<Page<DownloadReportDTO>> getTaskCount(@RequestBody DataExportListQO dataExportListQO) {
String enterpriseId = dataExportListQO.getEnterpriseId();
String clerkId = dataExportListQO.getClerkId();
DownloadReportQDTQ downloadReportQDTQ = new DownloadReportQDTQ();
downloadReportQDTQ.setCurrentPage(dataExportListQO.getPageNum());
downloadReportQDTQ.setPageSize(dataExportListQO.getPageSize());
downloadReportQDTQ.setEnterpriseId(enterpriseId);
downloadReportQDTQ.setApplyClerkId(clerkId);
DateTime date = DateUtil.date();
downloadReportQDTQ.setApplyStartTime(DateUtil.offset(date, DateField.YEAR, -1));
downloadReportQDTQ.setApplyEndTime(date);
downloadReportQDTQ.setProjectCode("haoban_new");
downloadReportQDTQ.setApplyStatus(2);
Page<DownloadReportDTO> page = downloadReportService.listDownloadReportByPage(downloadReportQDTQ);
return RestResponse.successResult(page) ;
}
}
package com.gic.haoban.manage.web.export;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DateUtil;
import com.gic.enterprise.api.dto.security.DownloadReportDTO;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
import com.gic.web.common.download.DownloadHandlerAbstract;
import com.gic.web.common.download.context.Context;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;
@Component
public class ContentMaterialClerkUsedDataHandler extends DownloadHandlerAbstract<MaterialClerkUsedDataVO> {
private static final Logger log = LoggerFactory.getLogger(ContentMaterialClerkUsedDataHandler.class);
@Autowired
private MaterialDataAdaptor materialDataAdaptor;
@Override
public List<MaterialClerkUsedDataVO> getData(Context context, String searchDataParams, Integer currentPage) {
MaterialAnalyzeDataQO materialStatisticsBaseQO = JSON.parseObject(searchDataParams, MaterialAnalyzeDataQO.class);
materialStatisticsBaseQO.setPageNum(currentPage);
materialStatisticsBaseQO.setPageSize(this.getPageSize());
Page<MaterialClerkUsedDataVO> clerkUsedData = materialDataAdaptor.queryMaterialClerkUsedData(materialStatisticsBaseQO,materialStatisticsBaseQO.getStoreIdList());
List<MaterialClerkUsedDataVO> result = clerkUsedData.getResult();
if (CollectionUtils.isEmpty(result)) {
return Collections.emptyList();
}
Integer mallType = materialStatisticsBaseQO.getMallType();
if (Objects.equals(mallType, 0)) {
result.forEach(x -> {
x.setConvsUserNum(x.getOfflineConvsUserNum());
x.setConvsAmt(x.getOfflineConvsAmt());
});
}
return result;
}
@Override
public List<String> getColumns() {
return Lists.newArrayList("storeName", "storeCode", "clerkName", "clerkCode",
"useMatlDayNum", "useMatlNum", "singleMatlAvgCnt", "convsUserNum", "convsAmt");
}
@Override
public LinkedHashMap<String, List<String>> doubleColumnNames() {
return null;
}
@Override
public List<String> getColumnNames() {
return Lists.newArrayList("门店名称", "门店code", "导购姓名", "导购code",
"使用素材天数", "使用素材数", "单个素材平均使用次数", "转化客户数", "转化金额");
}
@Override
public void callBack(Context context, boolean success) {
if (success) {
DownloadReportDTO downloadReportDTO = context.getDownloadReportDTO();
String clerkId = downloadReportDTO.getApplyClerkId();
String enterpriseId = downloadReportDTO.getEnterpriseId();
NoticeMessageUtil.sendDataExportNotify(enterpriseId, clerkId,
downloadReportDTO.getReportName(), downloadReportDTO.getApplyTime());
}
}
}
package com.gic.haoban.manage.web.export;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.enterprise.api.dto.security.DownloadReportDTO;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStoreAnalyzeDataQO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialStoreUsedDataVO;
import com.gic.web.common.download.DownloadHandlerAbstract;
import com.gic.web.common.download.context.Context;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;
@Component
public class ContentMaterialStoreUsedDataHandler extends DownloadHandlerAbstract<MaterialStoreUsedDataVO> {
private static final Logger log = LoggerFactory.getLogger(ContentMaterialStoreUsedDataHandler.class);
@Autowired
private MaterialDataAdaptor materialDataAdaptor;
@Override
public List<MaterialStoreUsedDataVO> getData(Context context, String searchDataParams, Integer currentPage) {
MaterialStoreAnalyzeDataQO materialStatisticsBaseQO = JSON.parseObject(searchDataParams, MaterialStoreAnalyzeDataQO.class);
materialStatisticsBaseQO.setPageNum(currentPage);
materialStatisticsBaseQO.setPageSize(this.getPageSize());
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO, materialStatisticsBaseQO.getStoreIdList());
List<MaterialStoreUsedDataVO> result = storeUsedData.getResult();
if (CollectionUtils.isEmpty(result)) {
return Collections.emptyList();
}
Integer mallType = materialStatisticsBaseQO.getMallType();
if (Objects.equals(mallType, 0)) {
result.forEach(x -> {
x.setConvUserNum(x.getOfflineConvUserNum());
x.setConvSalesNmt(x.getOfflineConvSalesNmt());
});
}
return result;
}
@Override
public List<String> getColumns() {
return Lists.newArrayList("storeName", "storeCode",
"dayAvgUseRate", "clickUserNum", "convUserNum", "convSalesNmt");
}
@Override
public LinkedHashMap<String, List<String>> doubleColumnNames() {
return null;
}
@Override
public List<String> getColumnNames() {
return Lists.newArrayList("门店名称", "门店code",
"日均使用导购占比", "点击客户数", "转化客户数", "转化金额");
}
@Override
public void callBack(Context context, boolean success) {
if (success) {
DownloadReportDTO downloadReportDTO = context.getDownloadReportDTO();
String clerkId = downloadReportDTO.getApplyClerkId();
String enterpriseId = downloadReportDTO.getEnterpriseId();
NoticeMessageUtil.sendDataExportNotify(enterpriseId, clerkId,
downloadReportDTO.getReportName(), downloadReportDTO.getApplyTime());
}
}
}
......@@ -3,6 +3,8 @@ package com.gic.haoban.manage.web.qo.content;
import com.gic.commons.web.qo.PageQo;
import com.gic.content.api.enums.MaterialSearchSceneEnum;
import java.util.List;
/**
* @Author MUSI
* @Date 2022/10/28 1:38 PM
......@@ -27,6 +29,11 @@ public class ContentMaterialQO extends PageQo {
private String wxEnterpriseId;
/**
* 素材id列表
*/
private List<Long> contentMaterialIdList;
/**
* 门店id
*/
private String storeId;
......@@ -118,6 +125,14 @@ public class ContentMaterialQO extends PageQo {
this.wxEnterpriseId = wxEnterpriseId;
}
public List<Long> getContentMaterialIdList() {
return contentMaterialIdList;
}
public void setContentMaterialIdList(List<Long> contentMaterialIdList) {
this.contentMaterialIdList = contentMaterialIdList;
}
public String getStoreId() {
return storeId;
}
......
......@@ -7,6 +7,8 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @Author MUSI
......@@ -38,6 +40,11 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
private String storeId;
/**
* 门店id列表
*/
private List<String> storeIdList;
/**
* 开始时间
*/
private String startDate;
......@@ -55,6 +62,11 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
private Integer storeStatusFilter;
/**
* 0线下 1线上
*/
private Integer mallType;
public String getEnterpriseId() {
return enterpriseId;
......@@ -80,6 +92,14 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
this.storeId = storeId;
}
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
public String getStartDate() {
if (StringUtils.isNotBlank(this.startDate)) {
return this.startDate;
......@@ -140,4 +160,21 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
return null;
}
}
public Integer getMallType() {
return mallType;
}
public void setMallType(Integer mallType) {
this.mallType = mallType;
}
public String getMallDesc() {
if (Objects.equals(this.mallType, 0)) {
return "线下";
} else if (Objects.equals(this.mallType, 1)) {
return "商城";
}
return "";
}
}
package com.gic.haoban.manage.web.qo.content.statistics;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
@Data
public class MaterialTodayDetailDataQO extends MaterialStatisticsBaseQO {
private static final long serialVersionUID = 3422937373665522931L;
/**
* 1企业2门店3导购
*/
private Integer dataType = 1;
/**
* 排序字段
* 日均使用导购占比
* 转化客户数
*/
private String orderByField;
/**
* asc
* desc
*/
private String order;
public Map<String, Integer> getFieldsOrder() {
Map<String, Integer> map = new HashMap<>();
map.put("convUserNum", 1);
map.put("convSalesAmt", 2);
map.put("offlineConvUserNum", 3);
map.put("offlineConvSalesAmt", 4);
map.put("clickUserNum", 5);
map.put("useMatluserCnt", 6);
map.put("useMatlClerkNum", 7);
map.put("unusedMatlClerkNum", 8);
return map;
}
public String getDefaultFields() {
return "useMatluserCnt";
}
}
package com.gic.haoban.manage.web.qo.data;
import com.gic.commons.web.qo.PageQo;
import java.io.Serializable;
public class DataExportListQO extends PageQo implements Serializable {
/**
* 导购ID
*/
private String clerkId ;
/**
* 企业ID
*/
private String enterpriseId ;
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
}
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gic.content.api.dto.additional.ContentMaterialAdditionalDTO;
import com.gic.content.api.dto.ext.ContentMaterialExt;
import com.gic.content.api.dto.material.ContentMaterialJson;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
......@@ -43,6 +44,11 @@ public class ContentMaterialInfoVO implements Serializable {
private String materialContent;
/**
* 素材JSON内容
*/
private ContentMaterialJson materialJson;
/**
* 素材类型1图文2纯文字3纯图片4视频5图文/视频6文件7富文本
*/
private Integer materialType;
......@@ -237,6 +243,14 @@ public class ContentMaterialInfoVO implements Serializable {
this.materialContent = materialContent;
}
public ContentMaterialJson getMaterialJson() {
return materialJson;
}
public void setMaterialJson(ContentMaterialJson materialJson) {
this.materialJson = materialJson;
}
public Integer getMaterialType() {
return materialType;
}
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.vo.content.creative;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gic.content.api.dto.material.ContentMaterialJson;
import java.util.Date;
import java.util.List;
......@@ -52,6 +53,10 @@ public class ContentMaterialVO extends ContentMaterialConvsVO{
*/
private String materialContent;
/**
* 素材JSON内容
*/
private ContentMaterialJson materialJson;
/**
* 素材图片url列表
*/
private String materialImageUrls;
......@@ -193,6 +198,14 @@ public class ContentMaterialVO extends ContentMaterialConvsVO{
this.materialContent = materialContent;
}
public ContentMaterialJson getMaterialJson() {
return materialJson;
}
public void setMaterialJson(ContentMaterialJson materialJson) {
this.materialJson = materialJson;
}
public String getMaterialImageUrls() {
return materialImageUrls;
}
......
......@@ -26,6 +26,11 @@ public class MaterialRealDataVO implements Serializable {
private Integer clickUserNum;
/**
* 使用次数
*/
private Integer useMatluserCnt;
/**
* 转换客户数
*/
private Integer convUserNum;
......@@ -82,6 +87,14 @@ public class MaterialRealDataVO implements Serializable {
this.clickUserNum = clickUserNum;
}
public Integer getUseMatluserCnt() {
return useMatluserCnt;
}
public void setUseMatluserCnt(Integer useMatluserCnt) {
this.useMatluserCnt = useMatluserCnt;
}
public Integer getConvUserNum() {
return convUserNum;
}
......
package com.gic.haoban.manage.web.vo.content.statistics;
import java.io.Serializable;
public class MaterialRealDetailDataVO extends MaterialRealDataVO implements Serializable {
/**
* 门店id
*/
private String storeId;
/**
* 门店code
*/
private String storeCode;
/**
* 门店名称
*/
private String storeName;
/**
* 导购id
*/
private String clerkId;
/**
* 导购名称
*/
private String clerkName;
/**
* 导购code
*/
private String clerkCode;
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getClerkName() {
return clerkName;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public String getClerkCode() {
return clerkCode;
}
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
}
......@@ -121,6 +121,8 @@
<dubbo:reference interface="com.gic.marketing.pro.api.service.offline.OfflinePreApiService" id="offlinePreApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.enterprise.api.service.AccountService" id="accountService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.DownloadReportService" id="downloadReportService" timeout="10000"/>
<dubbo:reference interface="com.gic.content.api.service.ContentColumnApiService" id="contentColumnApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.content.api.service.ContentMaterialApiService" id="contentMaterialApiService" timeout="10000" retries="0" check="false"/>
......
......@@ -11,7 +11,7 @@
http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 扫描注解包路径,多个包用逗号分隔,不填pacakge表示扫描当前ApplicationContext中所有的类 -->
<context:component-scan base-package="com.gic.haoban.*" />
<context:component-scan base-package="com.gic.haoban.*,com.gic.web.common.*" />
<!-- 启动对@AspectJ注解的支持 -->
<aop:aspectj-autoproxy />
......
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