Commit 27e37829 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-auth into developer

 Conflicts:
	gic-platform-auth-web/src/main/java/com/gic/auth/web/utils/ExcelUtils.java
parents c8bcdd34 d8ce25f6
......@@ -192,7 +192,6 @@ public interface TabSysMenuMapper {
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
* @throws
*/
@Deprecated
List<TabSysMenu> selectByProjectList(@Param("projectList") List<String> projectList);
/**
......
......@@ -694,7 +694,7 @@ public class MenuApiServiceImpl implements MenuApiService {
@Override
public ServiceResponse<Map<String, String>> getGicDefaultVersion() {
Map<String, String> map = new HashMap<>(16);
ServiceResponse<List<ServePropDTO>> versionListResult = serveApiService.listServePropByGICDefaultAPP();
ServiceResponse<List<ServePropDTO>> versionListResult = serveApiService.listServePropByGICDefaultApp();
if (versionListResult.isSuccess()) {
List<ServePropDTO> versionList = versionListResult.getResult();
if (CollectionUtils.isNotEmpty(versionList)) {
......
......@@ -384,9 +384,9 @@ public class ResourceApiServiceImpl implements ResourceApiService {
if (CollectionUtils.isNotEmpty(result)) {
defaultResource.setStoreIdList(result);
}
List<Integer> result2 = storeWidgetApiService.listStoreInfoIdByStoreWidgetId(user.getEnterpriseId(), orderResourceContentDTO.getStoreWidgetId()).getResult();
if (CollectionUtils.isNotEmpty(result2)) {
defaultResource.setStoreInfoIdList(result2);
List<Integer> resultTemp = storeWidgetApiService.listStoreInfoIdByStoreWidgetId(user.getEnterpriseId(), orderResourceContentDTO.getStoreWidgetId()).getResult();
if (CollectionUtils.isNotEmpty(resultTemp)) {
defaultResource.setStoreInfoIdList(resultTemp);
}
} else if (OrderResourceChannelEnum.DAMO_MALL.getCode().equals(orderResourceContentDTO.getChannel())) {
defaultResource.setShopIdList(orderResourceContentDTO.getStoreContent());
......
......@@ -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);
}
......
......@@ -298,7 +298,26 @@ public class MenuController {
ServiceResponse<Page<SystemSetLogDTO>> response = logApiService.listSystemSetLog(pageQO.getPageSize(),
pageQO.getCurrentPage(), searchParam);
return ResultControllerUtils.commonPageResult(response, LogListVO.class);
if (response.isSuccess()) {
Page page = (Page) response.getResult();
if (page == null) {
return RestResponse.success();
}
List<SystemSetLogDTO> responseList = page.getResult();
if (CollectionUtils.isNotEmpty(responseList)) {
List<LogListVO> resultList = responseList.stream().map(e -> {
LogListVO temp = EntityUtil.changeEntityNew(LogListVO.class, e);
temp.setNationCodeFrom(e.getRemark1());
temp.setPhoneFrom(e.getRemark2());
return temp;
}).collect(Collectors.toList());
page.setResult(resultList);
return RestResponse.success(page);
}
return RestResponse.success();
} else {
return RestResponse.failure(response.getCode(), response.getMessage());
}
}
public static List<Map<String, Object>> changePageListToTree(int storeGroupId, List<MenuDTO> list) {
......
......@@ -56,9 +56,9 @@ public class ExcelUtils {
for (int j = 0; j < everyLines.get(i).size(); j++) {
sheet.setColumnWidth(j, COLUMN_HEIGHT);
//将内容按顺序赋给对应的列对象
XSSFCell cell1 = row.createCell(j);
cell1.setCellValue(everyLines.get(i).get(j));
cell1.setCellStyle(style);
XSSFCell cellTemp = row.createCell(j);
cellTemp.setCellValue(everyLines.get(i).get(j));
cellTemp.setCellStyle(style);
}
}
return wb;
......@@ -127,8 +127,7 @@ public class ExcelUtils {
public static List<Map<Integer, String>> readXlsx(Workbook xssfWorkbook, int row, Map<Integer, Boolean> dateTypeMap) {
List<Map<Integer, String>> result = new ArrayList<Map<Integer, String>>();
String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT);
SimpleDateFormat format = new SimpleDateFormat(Constants.DATE_FORMAT);
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(in);
for (int numSheet = 0; numSheet < 1; numSheet++) {
Sheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
......@@ -153,16 +152,16 @@ public class ExcelUtils {
Boolean isDate = dateTypeMap.get(colix);
if (isDate != null && isDate) {
if (xssfCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
if (xssfCell.getCellTypeEnum() == CellType.NUMERIC) {
Date date = xssfCell.getDateCellValue();
map.put(colix, format.format(date));
} else {
xssfCell.setCellType(Cell.CELL_TYPE_STRING);
xssfCell.setCellType(CellType.STRING);
map.put(colix, xssfCell.getStringCellValue());
}
} else {
if (xssfCell.getCellType() != Cell.CELL_TYPE_STRING) {
xssfCell.setCellType(Cell.CELL_TYPE_STRING);
if (xssfCell.getCellTypeEnum() != CellType.STRING) {
xssfCell.setCellType(CellType.STRING);
}
map.put(colix, xssfCell.getStringCellValue());
}
......
......@@ -40,8 +40,8 @@ public class LogListVO implements Serializable{
private Long relationId;
private String businessName;
private String remark1;
private String remark2;
private String nationCodeFrom;
private String phoneFrom;
public Long getLogId() {
return logId;
......@@ -71,11 +71,11 @@ public class LogListVO implements Serializable{
}
public String getNationCode() {
return remark1;
return nationCodeFrom;
}
public String getPhone() {
return remark2;
return phoneFrom;
}
public String getProject() {
......@@ -132,21 +132,21 @@ public class LogListVO implements Serializable{
return this;
}
public String getRemark1() {
return remark1;
public String getNationCodeFrom() {
return nationCodeFrom;
}
public LogListVO setRemark1(String remark1) {
this.remark1 = remark1;
public LogListVO setNationCodeFrom(String nationCodeFrom) {
this.nationCodeFrom = nationCodeFrom;
return this;
}
public String getRemark2() {
return remark2;
public String getPhoneFrom() {
return phoneFrom;
}
public LogListVO setRemark2(String remark2) {
this.remark2 = remark2;
public LogListVO setPhoneFrom(String phoneFrom) {
this.phoneFrom = phoneFrom;
return this;
}
......@@ -164,8 +164,8 @@ public class LogListVO implements Serializable{
", createTime=" + createTime +
", relationId=" + relationId +
", businessName='" + businessName + '\'' +
", remark1='" + remark1 + '\'' +
", remark2='" + remark2 + '\'' +
", nationCodeFrom='" + nationCodeFrom + '\'' +
", phoneFrom='" + phoneFrom + '\'' +
'}';
}
}
package com.gic.auth.web.vo;
import java.io.Serializable;
/**
*
* @ClassName: TestObj
* @Description:
* @author zhiwj
* @date 2020-09-10 10:03
*/
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