Commit 19836046 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-auth into developer
parents 89d174bc cb1938e4
package com.gic.auth.dto;
import java.io.Serializable;
import java.util.List;
/**
*
......@@ -11,16 +12,12 @@ import java.io.Serializable;
public class OrderResourceContentDTO implements Serializable {
private static final long serialVersionUID = 1609787491094703550L;
/**
* 订单资源
[
{
"channel":1, // 渠道 1:线下门店, 2:达摩微商城, 3:微盟微商城
"storeContent":1 // 门店id或门店选择器id, 多个逗号隔开
}
]
"[{\"channel\":1,\"storeContent\":[],\"storeWidgetId\":1656}]"
*/
private Integer channel;
private String storeContent;
private List<Long> storeContent;
private Integer storeWidgetId;
public Integer getChannel() {
return channel;
......@@ -30,11 +27,19 @@ public class OrderResourceContentDTO implements Serializable {
this.channel = channel;
}
public String getStoreContent() {
public List<Long> getStoreContent() {
return storeContent;
}
public void setStoreContent(String storeContent) {
public void setStoreContent(List<Long> storeContent) {
this.storeContent = storeContent;
}
public Integer getStoreWidgetId() {
return storeWidgetId;
}
public void setStoreWidgetId(Integer storeWidgetId) {
this.storeWidgetId = storeWidgetId;
}
}
......@@ -16,6 +16,12 @@ public class OrderResourceDTO implements Serializable {
//
private List<Integer> storeIdList;
// 达摩微商城
private List<Long> shopIdList;
// 微盟微商城
private List<Long> wmStoreList;
public List<Integer> getStoreIdList() {
return storeIdList;
}
......@@ -31,4 +37,20 @@ public class OrderResourceDTO implements Serializable {
public void setType(Integer type) {
this.type = type;
}
public List<Long> getShopIdList() {
return shopIdList;
}
public void setShopIdList(List<Long> shopIdList) {
this.shopIdList = shopIdList;
}
public List<Long> getWmStoreList() {
return wmStoreList;
}
public void setWmStoreList(List<Long> wmStoreList) {
this.wmStoreList = wmStoreList;
}
}
......@@ -6,6 +6,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.application.center.api.service.AuthorizeService;
import com.gic.auth.constant.OrderOrAppEnum;
import com.gic.auth.constant.OrderResourceChannelEnum;
import com.gic.auth.constant.ResourceHoldEnum;
import com.gic.auth.dto.*;
import com.gic.auth.entity.TabSysOrderAppResource;
......@@ -328,11 +329,13 @@ public class ResourceApiServiceImpl implements ResourceApiService {
List<OrderResourceContentDTO> contentDTOList = JSON.parseArray(sysOrderAppResource.getContent(), OrderResourceContentDTO.class);
if (CollectionUtils.isNotEmpty(contentDTOList)) {
for (OrderResourceContentDTO orderResourceContentDTO : contentDTOList) {
if (OrderOrAppEnum.ORDER.getCode().equals(orderResourceContentDTO.getChannel())) {
List<Integer> result = storeWidgetApiService.listStoreIdByStoreWidgetId(user.getEnterpriseId(), Integer.valueOf(orderResourceContentDTO.getStoreContent())).getResult();
if (OrderResourceChannelEnum.OFFLINE.getCode().equals(orderResourceContentDTO.getChannel())) {
List<Integer> result = storeWidgetApiService.listStoreIdByStoreWidgetId(user.getEnterpriseId(), orderResourceContentDTO.getStoreWidgetId()).getResult();
if (CollectionUtils.isNotEmpty(result)) {
defaultResource.setStoreIdList(result);
}
} else if (OrderResourceChannelEnum.DAMO_MALL.getCode().equals(orderResourceContentDTO.getChannel())) {
defaultResource.setShopIdList(orderResourceContentDTO.getStoreContent());
}
}
}
......
package com.gic.auth.service.outer.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.auth.constant.OrderOrAppEnum;
import com.gic.auth.dto.OrderResourceContentDTO;
import com.gic.commons.util.EntityUtil;
import com.gic.goods.api.dto.selector.GoodsRightsSelectorWithRightsDTO;
import com.gic.goods.api.service.GoodsRightsSelectorApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.application.center.api.dto.ApplicationResourceDTO;
import com.gic.application.center.api.service.AuthorizeService;
import com.gic.auth.constant.OrderOrAppEnum;
import com.gic.auth.dto.OrderResourceContentDTO;
import com.gic.auth.dto.ResourceDTO;
import com.gic.auth.dto.open.*;
import com.gic.auth.entity.TabSysOrderAppResource;
import com.gic.auth.service.OrderAppResourceService;
import com.gic.auth.service.ResourceApiService;
import com.gic.auth.service.ResourceOpenApiService;
import com.gic.commons.util.EntityUtil;
import com.gic.gateway.sdk.anno.GatewayExporter;
import com.gic.gateway.sdk.anno.GatewayParams;
import com.gic.goods.api.dto.selector.GoodsRightsSelectorWithRightsDTO;
import com.gic.goods.api.service.GoodsRightsSelectorApiService;
import com.gic.member.config.api.dto.AppletsConfigSimpleOutputDTO;
import com.gic.member.config.api.dto.ChannelAreaInfoDTO;
import com.gic.member.config.api.dto.OwnerMemberCardDTO;
......@@ -42,6 +30,17 @@ import com.gic.member.config.api.service.ServiceConfigApiService;
import com.gic.member.filter.api.service.CuIndexOperaApiService;
import com.gic.store.dto.StoreDTO;
import com.gic.store.service.StoreWidgetApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("resourceOpenApiService")
@GatewayExporter
......@@ -121,7 +120,7 @@ public class ResourceOpenApiServiceImpl implements ResourceOpenApiService{
if (OrderOrAppEnum.ORDER.getCode().equals(orderResourceContentDTO.getChannel())) {
//查询门店资源组所有的门店权限
ServiceResponse<Page<StoreDTO>> storeResult = storeWidgetApiService
.listStoreByStoreWidgetId(enterpriseId, Integer.valueOf(orderResourceContentDTO.getStoreContent()), 1, 10000);
.listStoreByStoreWidgetId(enterpriseId, orderResourceContentDTO.getStoreWidgetId(), 1, 10000);
if (storeResult.isSuccess()) {
Page<StoreDTO> page = storeResult.getResult();
if (page == null) {
......
......@@ -114,12 +114,12 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11</version>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.gic </groupId>
......
package com.gic.auth.web.controller;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSON;
import com.gic.download.qo.HeaderQO;
import com.gic.enterprise.context.RequestContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -89,10 +92,11 @@ public class CollaboratorController extends DownloadUtils{
return result.getResult().getResult();
}
};
String[] headers = new String[] {"协作人名称", "手机号", "创建时间"};
List<HeaderQO> headerList = Stream.of(new HeaderQO("测试1", Arrays.asList("名称","时间","时间")),
new HeaderQO("测试2", null)).collect(Collectors.toList());
String[] fields = new String[] { "collaboratorName", "phone" , "createTime"};
try {
download(path, reportId, fileName, excelExtensionCode, Arrays.asList(headers), Arrays.asList(fields), loader, Arrays.asList("phone"), null);
downloadOfDoubleHeaderTitle(path, reportId, fileName, excelExtensionCode, headerList, Arrays.asList(fields), loader, Arrays.asList("phone"), null);
} catch (Exception e) {
LOGGER.warn(e);
}
......
......@@ -169,7 +169,7 @@ public class ExcelUtils {
private static XSSFCellStyle getTitleStyle(XSSFWorkbook workbook) {
XSSFCellStyle style = ExcelUtils.getColumnTopStyle(workbook);
style.setFillForegroundColor(IndexedColors.LIGHT_GREEN.getIndex());
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
// style.setFillPattern(CellStyle.SOLID_FOREGROUND);
return style;
}
......@@ -183,25 +183,25 @@ public class ExcelUtils {
// 设置字体大小
font.setFontHeightInPoints((short) 11);
// 字体加粗
font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
// font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
// 设置字体名字
font.setFontName("Courier New");
// 设置样式;
XSSFCellStyle style = workbook.createCellStyle();
// 设置底边框;
style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
// style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
// 设置底边框颜色;
// style.setBottomBorderColor(XSSFColor.BLACK.index);
// 设置左边框;
style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
// style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
// 设置左边框颜色;
// style.setLeftBorderColor(XSSFColor.BLACK.index);
// 设置右边框;
style.setBorderRight(XSSFCellStyle.BORDER_THIN);
// style.setBorderRight(XSSFCellStyle.BORDER_THIN);
// 设置右边框颜色;
// style.setRightBorderColor(XSSFColor.BLACK.index);
// 设置顶边框;
style.setBorderTop(XSSFCellStyle.BORDER_THIN);
// style.setBorderTop(XSSFCellStyle.BORDER_THIN);
// 设置顶边框颜色;
// style.setTopBorderColor(XSSFColor.BLACK.index);
// 在样式用应用设置的字体;
......@@ -209,9 +209,9 @@ public class ExcelUtils {
// 设置自动换行;
style.setWrapText(false);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
// style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
// 设置垂直对齐的样式为居中对齐;
style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
// style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
return style;
......@@ -234,19 +234,19 @@ public class ExcelUtils {
// 设置样式;
XSSFCellStyle style = workbook.createCellStyle();
// 设置底边框;
style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
// style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
// 设置底边框颜色;
// style.setBottomBorderColor(XSSFColor.BLACK.index);
// 设置左边框;
style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
// style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
// 设置左边框颜色;
// style.setLeftBorderColor(XSSFColor.BLACK.index);
// 设置右边框;
style.setBorderRight(XSSFCellStyle.BORDER_THIN);
// style.setBorderRight(XSSFCellStyle.BORDER_THIN);
// 设置右边框颜色;
// style.setRightBorderColor(XSSFColor.BLACK.index);
// 设置顶边框;
style.setBorderTop(XSSFCellStyle.BORDER_THIN);
// style.setBorderTop(XSSFCellStyle.BORDER_THIN);
// 设置顶边框颜色;
// style.setTopBorderColor(XSSFColor.BLACK.index);
// 在样式用应用设置的字体;
......@@ -254,9 +254,9 @@ public class ExcelUtils {
// 设置自动换行;
style.setWrapText(false);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
// style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
// 设置垂直对齐的样式为居中对齐;
style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
// style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
return style;
}
......
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