Commit cd7dc451 by guojuxing

pmd

parent bd1b4552
......@@ -12,7 +12,6 @@ import com.gic.auth.qo.MenuListQO;
import com.gic.auth.service.CollaboratorApiService;
import com.gic.auth.service.MenuApiService;
import com.gic.auth.web.vo.CollaboratorDetailVO;
import com.gic.auth.web.vo.TestObj;
import com.gic.commons.util.DateUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.*;
......@@ -85,51 +84,7 @@ public class CollaboratorController extends DownloadUtils{
Integer reportId = DataDownloadUtils.createDownloadReport(report);
//临时路径
String path = request.getSession().getServletContext().getRealPath("/excel/csv/collaborator/file/");
//异步生成文件并上传到腾讯云
ExecutorPoolSingleton.getInstance().executeTask(new Runnable() {
@Override
public void run() {
List<Map<String, Object>> dataList = new ArrayList<>();
Map<String, Object> map1 = new HashMap<>(8);
map1.put("test1", "test1");
map1.put("2", new TestObj("域名2门店1-1", "域名2门店2-1"));
map1.put("3", new TestObj("域名3门店1-1", "域名3门店2-1"));
dataList.add(map1);
Map<String, Object> map2 = new HashMap<>(8);
map2.put("test1", "test2");
map2.put("2", new TestObj("域名2门店1-2", "域名2门店2-2"));
map2.put("3", new TestObj("域名3门店1-2", "域名3门店2-2"));
dataList.add(map2);
DownloadDataLoader<Map<String, Object>> loader = new DownloadDataLoader<Map<String, Object>>() {
@Override
protected List<Map<String, Object>> getDownloadData(Integer pageNum) throws Exception {
params.setCurrentPage(pageNum);
if (PAGE_NUM_TEST.equals(pageNum)) {
//第二页结束test
return null;
}
return dataList;
}
};
LinkedHashMap<String, List<String>> headerList = new LinkedHashMap<>();
headerList.put("测试1", null);
headerList.put("域名2", Arrays.asList("门店1", "门店2"));
headerList.put("域名3", Arrays.asList("门店1", "门店2"));
LinkedHashMap<String, List<String>> propertyNameList = new LinkedHashMap<>();
propertyNameList.put("test1", null);
propertyNameList.put("2", Arrays.asList("store1", "store2"));
propertyNameList.put("3", Arrays.asList("store1", "store2"));
Map<String, List<String>> needEncryptField = new HashMap<>(16);
needEncryptField.put("test1", null);
needEncryptField.put("2", Arrays.asList("store1"));
needEncryptField.put("3", Arrays.asList("store2"));
try {
downloadForDoubleHeaderTitle(path, reportId, fileName, excelExtensionCode, headerList, propertyNameList, loader, needEncryptField, null);
} catch (Exception e) {
LOGGER.warn(e);
}
}
});
return RestResponse.success(reportId);
}
......
package com.gic.auth.web.vo;
import com.gic.commons.annotation.SkipNamingCheck;
import java.io.Serializable;
/**
*
* @ClassName: TestObj
* @Description:
* @author zhiwj
* @date 2020-09-10 10:03
*/
@SkipNamingCheck
public class TestObj implements Serializable{
private static final long serialVersionUID = -4882149987195822359L;
private String store1;
private String store2;
public TestObj() {
}
public TestObj(String store1, String store2) {
this.store1 = store1;
this.store2 = store2;
}
public String getStore1() {
return store1;
}
public TestObj setStore1(String store1) {
this.store1 = store1;
return this;
}
public String getStore2() {
return store2;
}
public TestObj setStore2(String store2) {
this.store2 = store2;
return this;
}
}
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