|
@@ -3,12 +3,9 @@ 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;
|
|
@@ -28,7 +25,6 @@ import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* 首投有效数据导入
|
|
@@ -51,13 +47,12 @@ public class FirstDeliveryValidController {
|
|
|
*/
|
|
|
@PostMapping(value = "/importExcelMaterials")
|
|
|
@ResponseBody
|
|
|
- public void importExcelMaterials(HttpServletResponse response, @RequestParam("file") MultipartFile file) throws Exception {
|
|
|
+ public Result<Object> 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("/");
|
|
|
+ path.append(downloadPath).append("excel").append("/").append(DateUtils.formatDate()).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);
|
|
|
+ return Result.successMsg("ok", null);
|
|
|
}
|
|
|
|
|
|
/**
|