|
@@ -3,11 +3,17 @@ package cn.com.ctop.toutiao.modules.material.controller;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.ExportExcelUtils;
|
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
+import cn.com.ctop.common.module.utils.LoadFileUtil;
|
|
|
+import cn.com.ctop.shiwan.modules.FileUtil;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.FirstDeliveryValidService;
|
|
|
+import cn.com.ctop.toutiao.modules.tool.constants.AudiencePackageUrlConstant;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.xxl.job.core.context.XxlJobHelper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -22,6 +28,7 @@ import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* 首投有效数据导入
|
|
@@ -33,12 +40,32 @@ public class FirstDeliveryValidController {
|
|
|
@Resource
|
|
|
private FirstDeliveryValidService firstDeliveryValidService;
|
|
|
|
|
|
+ @Value("${zip.local.download-path}")
|
|
|
+ private String downloadPath;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 导入EXCEL批量创建
|
|
|
+ * ruixuan 服务
|
|
|
* 返点-首投有效素材明细
|
|
|
*/
|
|
|
@PostMapping(value = "/importExcelMaterials")
|
|
|
@ResponseBody
|
|
|
+ public void importExcelMaterials(HttpServletResponse response, @RequestParam("file") MultipartFile file) throws Exception {
|
|
|
+ StringBuffer path = new StringBuffer();
|
|
|
+ path.append(downloadPath).append(DateUtils.formatDate()).append("/").append(UUID.randomUUID().toString()).append("/");
|
|
|
+ String newFileUrl = FileUtil.approvalFile(file, path.toString());
|
|
|
+ HttpUtils.fileUpload("http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/importExcelMaterials", newFileUrl, null);
|
|
|
+ Thread.sleep(30000L);
|
|
|
+ LoadFileUtil.delFile(newFileUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导入EXCEL批量创建
|
|
|
+ * 返点-首投有效素材明细
|
|
|
+ */
|
|
|
+ /* @PostMapping(value = "/importExcelMaterials")
|
|
|
+ @ResponseBody
|
|
|
public Result<Object> importExcelMaterials(HttpServletResponse response, @RequestParam("file") MultipartFile file) {
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
try {
|
|
@@ -50,7 +77,7 @@ public class FirstDeliveryValidController {
|
|
|
e.printStackTrace();
|
|
|
return Result.error("导入EXCEL失败," + e.getMessage());
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
/**
|