Commit a9cdcab2 by 王祖波

数据导出

parent ede647c3
...@@ -2,15 +2,18 @@ package com.gic.haoban.manage.web.controller.content; ...@@ -2,15 +2,18 @@ package com.gic.haoban.manage.web.controller.content;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.gic.api.base.commons.BasePageInfo; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse; 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.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse; 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.ContentMaterialDTO;
import com.gic.content.api.dto.material.ContentMaterialFrontDTO; import com.gic.content.api.dto.material.ContentMaterialFrontDTO;
import com.gic.content.api.enums.MaterialSearchSceneEnum; 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.ContentMaterialPageFrontQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageQDTO; import com.gic.content.api.qdto.material.ContentMaterialPageQDTO;
import com.gic.content.api.service.ContentMaterialApiService; import com.gic.content.api.service.ContentMaterialApiService;
...@@ -19,6 +22,8 @@ import com.gic.enterprise.api.service.StoreService; ...@@ -19,6 +22,8 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.manage.api.enums.content.MaterialReportType; 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.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor; 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.ContentMaterialBaseQO;
import com.gic.haoban.manage.web.qo.content.statistics.*; import com.gic.haoban.manage.web.qo.content.statistics.*;
import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils; import com.gic.haoban.manage.web.utils.storestatusfilter.StoreStatusFilterUtils;
...@@ -30,22 +35,22 @@ import com.gic.haoban.manage.web.vo.content.statistics.MaterialRealDataVO; ...@@ -30,22 +35,22 @@ 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.MaterialStoreUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO; 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.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.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
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.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -66,6 +71,10 @@ public class MaterialDataStaticsController { ...@@ -66,6 +71,10 @@ public class MaterialDataStaticsController {
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private StoreService storeService; private StoreService storeService;
@Autowired
private ContentMaterialClerkUsedDataHandler materialClerkUsedDataHandler;
@Autowired
private ContentMaterialStoreUsedDataHandler materialStoreUsedDataHandler;
/** /**
* 获取素材首页数据 * 获取素材首页数据
...@@ -189,6 +198,53 @@ public class MaterialDataStaticsController { ...@@ -189,6 +198,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(2);
task.setUser(user);
task.setTotalCount(total);
String fileName = "素材-导购数据导出";
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 * @return
...@@ -203,28 +259,56 @@ public class MaterialDataStaticsController { ...@@ -203,28 +259,56 @@ public class MaterialDataStaticsController {
storeIds.add(materialStatisticsBaseQO.getStoreId()); storeIds.add(materialStatisticsBaseQO.getStoreId());
} }
Page<MaterialStoreUsedDataVO> storeUsedData = materialDataAdaptor.queryMaterialStoreUsedData(materialStatisticsBaseQO,storeIds); 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); 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 = "素材-门店数据导出";
DownloadTask task = new DownloadTask();
task.setTaskTypeEnum(TaskTypeEnum.CONTENT_USED_DOWNLOAD);
task.setDataType(2);
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());
}
// 导购 周报/月报数据 // 导购 周报/月报数据
......
...@@ -9,7 +9,9 @@ import com.gic.api.base.commons.BasePageInfo; ...@@ -9,7 +9,9 @@ import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.DataApiUtils; import com.gic.commons.util.DataApiUtils;
import com.gic.enterprise.api.dto.EnterpriseDTO; 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.EnterpriseService;
import com.gic.enterprise.api.service.StoreService;
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.MaterialAnalyzeDataQO; 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.MaterialReportQO;
...@@ -27,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -27,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -105,6 +108,8 @@ public class MaterialDataAdaptor { ...@@ -105,6 +108,8 @@ public class MaterialDataAdaptor {
@Autowired @Autowired
private EnterpriseService enterpriseService; private EnterpriseService enterpriseService;
@Autowired
private StoreService storeService;
/** /**
...@@ -217,6 +222,25 @@ public class MaterialDataAdaptor { ...@@ -217,6 +222,25 @@ public class MaterialDataAdaptor {
} }
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_STORE_DATA); Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_STORE_DATA);
Page<MaterialStoreUsedDataVO> pageData = DataApiUtils.getPageData(result, MaterialStoreUsedDataVO.class); 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; 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.setDataType(2);
downloadReportQDTQ.setProjectCode("haoban_new");
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;
@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)) {
result.forEach(x -> {
x.setConvsUserNum(x.getConvsUserNum() + x.getOfflineConvsUserNum());
x.setConvsAmt(x.getConvsAmt().add(x.getOfflineConvsAmt()));
});
return Collections.emptyList();
}
return result;
}
@Override
public List<String> getColumnNames() {
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> getColumns() {
return Lists.newArrayList("门店名称", "门店code", "导购姓名", "导购code",
"使用素材天数", "使用素材数", "单个素材平均使用次数", "转化客户数", "转化金额");
}
@Override
public void callBack(Context context) {
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;
@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)) {
result.forEach(x -> {
x.setConvUserNum(x.getConvUserNum() + x.getOfflineConvUserNum());
x.setConvSalesNmt(x.getConvSalesNmt().add(x.getOfflineConvSalesNmt()));
});
return Collections.emptyList();
}
return result;
}
@Override
public List<String> getColumnNames() {
return Lists.newArrayList("storeName", "storeCode",
"dayAvgUseRate", "clickUserNum", "convUserNum", "convSalesNmt");
}
@Override
public LinkedHashMap<String, List<String>> doubleColumnNames() {
return null;
}
@Override
public List<String> getColumns() {
return Lists.newArrayList("门店名称", "门店code",
"日均使用导购占比", "点击客户数", "转化客户数", "转化金额");
}
@Override
public void callBack(Context context) {
DownloadReportDTO downloadReportDTO = context.getDownloadReportDTO();
String clerkId = downloadReportDTO.getApplyClerkId();
String enterpriseId = downloadReportDTO.getEnterpriseId();
NoticeMessageUtil.sendDataExportNotify(enterpriseId, clerkId,
downloadReportDTO.getReportName(), downloadReportDTO.getApplyTime());
}
}
...@@ -7,6 +7,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -7,6 +7,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author MUSI * @Author MUSI
...@@ -38,6 +39,11 @@ public class MaterialStatisticsBaseQO extends BasePageInfo { ...@@ -38,6 +39,11 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
private String storeId; private String storeId;
/** /**
* 门店id列表
*/
private List<String> storeIdList;
/**
* 开始时间 * 开始时间
*/ */
private String startDate; private String startDate;
...@@ -80,6 +86,14 @@ public class MaterialStatisticsBaseQO extends BasePageInfo { ...@@ -80,6 +86,14 @@ public class MaterialStatisticsBaseQO extends BasePageInfo {
this.storeId = storeId; this.storeId = storeId;
} }
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
public String getStartDate() { public String getStartDate() {
if (StringUtils.isNotBlank(this.startDate)) { if (StringUtils.isNotBlank(this.startDate)) {
return this.startDate; return this.startDate;
......
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;
}
}
...@@ -121,6 +121,8 @@ ...@@ -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.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.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.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"/> <dubbo:reference interface="com.gic.content.api.service.ContentMaterialApiService" id="contentMaterialApiService" timeout="10000" retries="0" check="false"/>
......
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