|
@@ -3,6 +3,7 @@ package com.caimei365.manager.service.caimei.user.impl;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
+import com.aspose.slides.p2cbca448.imp;
|
|
|
import com.caimei.utils.MathUtil;
|
|
|
import com.caimei.utils.StringUtils;
|
|
|
import com.caimei365.manager.dao.user.CmMarketShopDao;
|
|
@@ -52,9 +53,11 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:dd");
|
|
|
|
|
|
- @Resource private CmMarketShopDao marketShopDao;
|
|
|
+ @Resource
|
|
|
+ private CmMarketShopDao marketShopDao;
|
|
|
|
|
|
- @Resource private formDataUtils formDataUtils;
|
|
|
+ @Resource
|
|
|
+ private formDataUtils formDataUtils;
|
|
|
|
|
|
/**
|
|
|
* 上传供应商营销logo
|
|
@@ -162,7 +165,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson saveMarketReport( MultipartFile reportFile) throws IOException {
|
|
|
+ public ResponseJson saveMarketReport(MultipartFile reportFile) throws IOException {
|
|
|
|
|
|
boolean isZipPack = true;
|
|
|
|
|
@@ -173,12 +176,12 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
boolean mkdirs = packFile.mkdirs();
|
|
|
}
|
|
|
|
|
|
- if (reportFile== null) {
|
|
|
+ if (reportFile == null) {
|
|
|
return ResponseJson.error(-1, "请上传文件", null);
|
|
|
}
|
|
|
String contentType = reportFile.getContentType();
|
|
|
String filename = reportFile.getOriginalFilename();
|
|
|
- log.info("contentType===="+contentType);
|
|
|
+ log.info("contentType====" + contentType);
|
|
|
//将压缩包保存在指定路径
|
|
|
String packFilePath = extract + File.separator + filename;
|
|
|
if (contentType.contains(ZIP_FILE)) {
|
|
@@ -207,8 +210,8 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
}
|
|
|
//获取压缩包名称
|
|
|
filename = filename.substring(0, filename.lastIndexOf("."));
|
|
|
- log.info("filename===="+filename);
|
|
|
- log.info("packFilePath===="+packFilePath);
|
|
|
+ log.info("filename====" + filename);
|
|
|
+ log.info("packFilePath====" + packFilePath);
|
|
|
if (file.exists()) {
|
|
|
file.delete();
|
|
|
}
|
|
@@ -339,7 +342,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
}
|
|
|
}
|
|
|
try {
|
|
|
- shopInfo.setChartTitle("【"+shopInfo.getName()+"】"+dateFormat.format(dateFormat.parse(shopInfo.getAddTime())) + "数据报表");
|
|
|
+ shopInfo.setChartTitle("【" + shopInfo.getName() + "】" + dateFormat.format(dateFormat.parse(shopInfo.getAddTime())) + "数据报表");
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -382,12 +385,13 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
map.put("wechats", articleReturnData);
|
|
|
// 获取展现量数据
|
|
|
List<Impressions> marketImpressions = marketShopDao.getMarketImpressions(id);
|
|
|
- int generalNumber = 0, microBlog = 0, redBookNumber = 0, otherNumber = 0;
|
|
|
+ int generalNumber = 0, microBlog = 0, redBookNumber = 0, otherNumber = 0, pointSingNumber = 0;
|
|
|
if (null != marketImpressions && marketImpressions.size() > 0) {
|
|
|
for (Impressions imp : marketImpressions) {
|
|
|
generalNumber += imp.getGeneralNumber();
|
|
|
microBlog += imp.getMicroBlog();
|
|
|
redBookNumber += imp.getRedBookNumber();
|
|
|
+ pointSingNumber += imp.getPointSingNumber();
|
|
|
otherNumber += imp.getOtherNumber();
|
|
|
}
|
|
|
}
|
|
@@ -395,11 +399,13 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
name.add("公众号");
|
|
|
name.add("微博");
|
|
|
name.add("小红书");
|
|
|
+ name.add("一点号");
|
|
|
name.add("其它自媒体渠道");
|
|
|
returnData.setNames(name);
|
|
|
value.add(generalNumber);
|
|
|
value.add(microBlog);
|
|
|
value.add(redBookNumber);
|
|
|
+ value.add(pointSingNumber);
|
|
|
value.add(otherNumber);
|
|
|
returnData.setValues(value);
|
|
|
map.put("intention", returnData);
|
|
@@ -412,6 +418,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
generalNumber += readVolume.getGeneralNumber();
|
|
|
microBlog += readVolume.getMicroBlog();
|
|
|
redBookNumber += readVolume.getRedBookNumber();
|
|
|
+ pointSingNumber += readVolume.getPointSingNumber();
|
|
|
otherNumber += readVolume.getOtherNumber();
|
|
|
}
|
|
|
}
|
|
@@ -419,11 +426,13 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
name.add("公众号");
|
|
|
name.add("微博");
|
|
|
name.add("小红书");
|
|
|
+ name.add("一点号");
|
|
|
name.add("其它自媒体渠道");
|
|
|
returnData.setNames(name);
|
|
|
value.add(generalNumber);
|
|
|
value.add(microBlog);
|
|
|
value.add(redBookNumber);
|
|
|
+ value.add(pointSingNumber);
|
|
|
value.add(otherNumber);
|
|
|
returnData.setValues(value);
|
|
|
map.put("allVisits", readVolumeReturnData);
|
|
@@ -565,7 +574,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
List<String> region = marketShopDao.getRegion(accessDate, shopKeyword);
|
|
|
Set<String> province = new HashSet<>();
|
|
|
String com = "";
|
|
|
- for (String str : region ) {
|
|
|
+ for (String str : region) {
|
|
|
String trim = str.trim();
|
|
|
com = trim.substring(0, 2);
|
|
|
province.add(com);
|
|
@@ -585,6 +594,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
|
|
|
/**
|
|
|
* 读取文件夹数据————指定格式 (营销供应商)
|
|
|
+ *
|
|
|
* @param marketReportId
|
|
|
* @param filePath
|
|
|
* @throws IOException
|
|
@@ -598,7 +608,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
Map<String, String> advertImageInfoList = new HashMap<>();
|
|
|
File file = new File(filePath);
|
|
|
if (file.exists() && file.isDirectory()) {
|
|
|
- for (File fileSpecific: file.listFiles()) {
|
|
|
+ for (File fileSpecific : file.listFiles()) {
|
|
|
if (fileSpecific.getName().equals("SEO汇总图片") && fileSpecific.exists() && fileSpecific.isDirectory()) {
|
|
|
for (File fileSpecificContain : fileSpecific.listFiles()) {
|
|
|
if (fileSpecificContain.getName().contains("seo")) {
|
|
@@ -610,10 +620,10 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.info("fileSpecific.getName()======"+fileSpecific.getName());
|
|
|
+ log.info("fileSpecific.getName()======" + fileSpecific.getName());
|
|
|
if (fileSpecific.getName().equals("advert广告图片") && fileSpecific.exists() && fileSpecific.isDirectory()) {
|
|
|
for (File fileSpecificContain : fileSpecific.listFiles()) {
|
|
|
- log.info("fileSpecificContain.getName()======"+fileSpecificContain.getName());
|
|
|
+ log.info("fileSpecificContain.getName()======" + fileSpecificContain.getName());
|
|
|
if (fileSpecificContain.getName().contains("首页")) {
|
|
|
// 上传图到服务器并获取图链接,存入数据库,图片名称需与 广告图点击量 列表名称一致
|
|
|
MultipartFile filex = FileUtil.fileToMultipartFileConverter(fileSpecificContain);
|
|
@@ -632,7 +642,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
}
|
|
|
}
|
|
|
// 读取完图片文件后在读取数据文件 xlsx
|
|
|
- for (File fileSpecific: file.listFiles()) {
|
|
|
+ for (File fileSpecific : file.listFiles()) {
|
|
|
if (fileSpecific.getName().endsWith(".xlsx") || fileSpecific.getName().endsWith(".xls")) {
|
|
|
readExcel(marketReportId, fileSpecific, seoImagePathList, advertImageHomeList, advertImageInfoList);
|
|
|
}
|
|
@@ -643,6 +653,7 @@ public class CmMarketShopServiceImpl implements CmMarketShopService {
|
|
|
|
|
|
/**
|
|
|
* 多sheet excel文件读取 -- 指定sheet名称 多sheet读取必须多次创建文件流
|
|
|
+ *
|
|
|
* @param marketReportId
|
|
|
* @param file
|
|
|
* @param seoImagePathList
|