1、角色添加匹配方法
2、幂等性去掉统一提示前缀 3、excel导出添加新的style
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
package com.chinaunicom.mall.ebtp.common.constant;
|
package com.chinaunicom.mall.ebtp.common.constant;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public enum EbtpRoleEnum {
|
public enum EbtpRoleEnum {
|
||||||
|
|
||||||
|
|
||||||
@ -25,6 +27,8 @@ public enum EbtpRoleEnum {
|
|||||||
|
|
||||||
SYSTEM_ADMIN("ebtp-system-admin", "EBTP系统管理员"),
|
SYSTEM_ADMIN("ebtp-system-admin", "EBTP系统管理员"),
|
||||||
|
|
||||||
|
DEFAULT("", ""),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -38,6 +42,15 @@ public enum EbtpRoleEnum {
|
|||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EbtpRoleEnum matchDesc(String desc) {
|
||||||
|
return Arrays.stream(values()).filter(o -> o.getDesc().equals(desc)).findAny().orElse(DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EbtpRoleEnum matchRole(String role) {
|
||||||
|
return Arrays.stream(values()).filter(o -> o.getRole().equals(role)).findAny().orElse(DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getRole() {
|
public String getRole() {
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class IdempotentAspect {
|
|||||||
String value = LocalDateTime.now().toString().replace("T", " ");
|
String value = LocalDateTime.now().toString().replace("T", " ");
|
||||||
if (null != rMapCache.get(key)) {
|
if (null != rMapCache.get(key)) {
|
||||||
// had stored
|
// had stored
|
||||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("[idempotent]:" + info,true);
|
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName(info,true);
|
||||||
}
|
}
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
boolean submitAble = redisTemplate.opsForValue().setIfAbsent(key, value,expireTime,timeUnit);
|
boolean submitAble = redisTemplate.opsForValue().setIfAbsent(key, value,expireTime,timeUnit);
|
||||||
|
@ -140,10 +140,50 @@ public class ExportConstant {
|
|||||||
}else if("content_black".equals(key)){
|
}else if("content_black".equals(key)){
|
||||||
|
|
||||||
return ExportConstant.getContentStyle(wb,"宋体",11,color);
|
return ExportConstant.getContentStyle(wb,"宋体",11,color);
|
||||||
|
}else if("noBorderCenter16".equals(key)){
|
||||||
|
return ExportConstant.noBorderCenter16(wb);
|
||||||
|
}else if("noBorderLeft12".equals(key)){
|
||||||
|
return ExportConstant.noBorderLeft12(wb);
|
||||||
|
}else if("noBorderRight12".equals(key)){
|
||||||
|
return ExportConstant.noBorderRight12(wb);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExportConstant.getContentStyle(wb,"宋体",11,color);
|
return ExportConstant.getContentStyle(wb,"宋体",11,color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static XSSFCellStyle noBorderCenter16(XSSFWorkbook wb){
|
||||||
|
XSSFCellStyle cellStyle = wb.createCellStyle();
|
||||||
|
cellStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||||
|
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||||
|
|
||||||
|
XSSFFont font = wb.createFont();
|
||||||
|
font.setFontHeightInPoints((short) 16);
|
||||||
|
cellStyle.setFont(font);
|
||||||
|
return cellStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static XSSFCellStyle noBorderLeft12(XSSFWorkbook wb){
|
||||||
|
XSSFCellStyle cellStyle = wb.createCellStyle();
|
||||||
|
cellStyle.setAlignment(HorizontalAlignment.LEFT);//水平居左
|
||||||
|
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||||
|
|
||||||
|
XSSFFont font = wb.createFont();
|
||||||
|
font.setFontHeightInPoints((short) 12);
|
||||||
|
cellStyle.setFont(font);
|
||||||
|
return cellStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static XSSFCellStyle noBorderRight12(XSSFWorkbook wb){
|
||||||
|
XSSFCellStyle cellStyle = wb.createCellStyle();
|
||||||
|
cellStyle.setAlignment(HorizontalAlignment.RIGHT);//水平居右
|
||||||
|
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||||
|
|
||||||
|
XSSFFont font = wb.createFont();
|
||||||
|
font.setFontHeightInPoints((short) 12);
|
||||||
|
cellStyle.setFont(font);
|
||||||
|
return cellStyle;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取表头项目名称一列的样式
|
* 获取表头项目名称一列的样式
|
||||||
* @param wb 文本对象
|
* @param wb 文本对象
|
||||||
|
Reference in New Issue
Block a user