master
wangbing 5 years ago
parent e0f06eb14f
commit 356331b1fc

@ -309,7 +309,7 @@ public class GlobalController implements ErrorController {
return baseResponse; return baseResponse;
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
BaseResponse baseResponse = new BaseResponse(); BaseResponse baseResponse = new BaseResponse();
baseResponse.addError(ErrorType.BUSINESS_ERROR, "方法执行错误!"); baseResponse.addError(ErrorType.BUSINESS_ERROR, "方法执行错误[" + e.getTargetException().getMessage() + "]");
return baseResponse; return baseResponse;
} }
} }

@ -11,12 +11,14 @@ import ${basePackage}.frame.excel.exception.ReadErrorException;
import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException;
import ${basePackage}.frame.utils.MapperUtil; import ${basePackage}.frame.utils.MapperUtil;
import ${basePackage}.frame.utils.ResponseUtil; import ${basePackage}.frame.utils.ResponseUtil;
import ${basePackage}.frame.utils.ValidationUtil;
import ${basePackage}.module.system.ent.Dict; import ${basePackage}.module.system.ent.Dict;
import ${basePackage}.module.system.mgr.DictManager; import ${basePackage}.module.system.mgr.DictManager;
import ${basePackage}.module.system.req.*; import ${basePackage}.module.system.req.*;
import ${basePackage}.module.system.rsp.*; import ${basePackage}.module.system.rsp.*;
import java.io.IOException; import java.io.IOException;
import java.util.List;
public class DictAjax { public class DictAjax {
@ -69,10 +71,16 @@ public class DictAjax {
public Object imports(MultipartFile file) { public Object imports(MultipartFile file) {
BaseResponse baseResponse = new BaseResponse(); BaseResponse baseResponse = new BaseResponse();
try { try {
WSheet<Dict> sheet = new WSheet<>(file.getBytes(), Dict.class); WSheet<Dict> sheet = new WSheet<>(file.getBytes(), Dict.class, new WSheet.Validator<Dict>() {
@Override
public List<String> validate(Dict o) {
DictCreateRequest request = MapperUtil.map(o, DictCreateRequest.class);
return ValidationUtil.validate(request);
}
});
if (sheet.hasError()) { if (sheet.hasError()) {
return ResponseUtil.apply(sheet.getBytes(), sheet.getName() + "-err.xlsx"); return ResponseUtil.apply(sheet.getBytes(true), sheet.getName() + "-err.xlsx");
} else { } else {
return baseResponse; return baseResponse;
} }

@ -11,9 +11,13 @@ import java.util.Date;
* @version 0.0.1 * @version 0.0.1
* @since 2017-01-01 * @since 2017-01-01
*/ */
public class BaseEntity implements Serializable { public class BaseEntity implements Serializable {
/**
*
*/
private long id;
/** /**
* *
*/ */
@ -48,14 +52,6 @@ public class BaseEntity implements Serializable {
@JsonIgnore @JsonIgnore
private boolean isDeleted; private boolean isDeleted;
public boolean getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
public long getRowVersion() { public long getRowVersion() {
return rowVersion; return rowVersion;
} }
@ -64,20 +60,20 @@ public class BaseEntity implements Serializable {
this.rowVersion = rowVersion; this.rowVersion = rowVersion;
} }
public long getCreateBy() { public long getId() {
return createBy; return id;
} }
public void setCreateBy(long createBy) { public void setId(long id) {
this.createBy = createBy; this.id = id;
} }
public long getLastUpdateBy() { public long getCreateBy() {
return lastUpdateBy; return createBy;
} }
public void setLastUpdateBy(long lastUpdateBy) { public void setCreateBy(long createBy) {
this.lastUpdateBy = lastUpdateBy; this.createBy = createBy;
} }
public Date getCreateTime() { public Date getCreateTime() {
@ -88,6 +84,14 @@ public class BaseEntity implements Serializable {
this.createTime = createTime; this.createTime = createTime;
} }
public long getLastUpdateBy() {
return lastUpdateBy;
}
public void setLastUpdateBy(long lastUpdateBy) {
this.lastUpdateBy = lastUpdateBy;
}
public Date getLastUpdateTime() { public Date getLastUpdateTime() {
return lastUpdateTime; return lastUpdateTime;
} }
@ -95,4 +99,12 @@ public class BaseEntity implements Serializable {
public void setLastUpdateTime(Date lastUpdateTime) { public void setLastUpdateTime(Date lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime; this.lastUpdateTime = lastUpdateTime;
} }
public boolean isDeleted() {
return isDeleted;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
}
} }

@ -6,6 +6,7 @@ import ${basePackage}.frame.utils.StringUtil;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method;
/** /**
* WColumn - Excel() * WColumn - Excel()
@ -36,7 +37,14 @@ public class WColumn implements Serializable {
*/ */
private Converter converter; private Converter converter;
/**
* Field
*/
private Field field; private Field field;
/**
* set
*/
private Method setMethod;
private int cellType = 1; private int cellType = 1;
@ -112,4 +120,12 @@ public class WColumn implements Serializable {
public void setCellType(int cellType) { public void setCellType(int cellType) {
this.cellType = cellType; this.cellType = cellType;
} }
public Method getSetMethod() {
return setMethod;
}
public void setSetMethod(Method setMethod) {
this.setMethod = setMethod;
}
} }

@ -1,12 +1,13 @@
package ${basePackage}.frame.excel; package ${basePackage}.frame.excel;
import ${basePackage}.frame.excel.converter.Converter;
import ${basePackage}.frame.excel.exception.ValueConverterException;
import ${basePackage}.frame.excel.style.DataCellStyle; import ${basePackage}.frame.excel.style.DataCellStyle;
import ${basePackage}.frame.excel.style.ErrorCellStyle; import ${basePackage}.frame.excel.style.ErrorCellStyle;
import ${basePackage}.frame.excel.style.HeadCellStyle; import ${basePackage}.frame.excel.style.HeadCellStyle;
import ${basePackage}.frame.excel.style.RedFont; import ${basePackage}.frame.excel.style.RedFont;
import ${basePackage}.frame.utils.ClassUtil; import ${basePackage}.frame.utils.ClassUtil;
import ${basePackage}.frame.utils.LogUtil; import ${basePackage}.frame.utils.LogUtil;
import ${basePackage}.frame.utils.StringUtil;
import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.frame.utils.ValidationUtil;
import ${basePackage}.frame.excel.annotation.*; import ${basePackage}.frame.excel.annotation.*;
import ${basePackage}.frame.excel.converter.*; import ${basePackage}.frame.excel.converter.*;
@ -64,7 +65,7 @@ public class WSheet<T> implements Serializable, Cloneable {
/** /**
* DataTable * DataTable
* *
* @return @NameSet * @return WColumn
*/ */
private List<WColumn> initColumns(Class<?> clazz) { private List<WColumn> initColumns(Class<?> clazz) {
//获取工作簿名称,没有则以类名为默认工作簿名称 //获取工作簿名称,没有则以类名为默认工作簿名称
@ -87,6 +88,9 @@ public class WSheet<T> implements Serializable, Cloneable {
WColumn WColumn = new WColumn(); WColumn WColumn = new WColumn();
WColumn.setField(field); WColumn.setField(field);
Method set = ClassUtil.setMethod(field.getName(), clazz, field.getType());
WColumn.setSetMethod(set);
//获取列名称 //获取列名称
if (!field.isAnnotationPresent(ColumnName.class)) { if (!field.isAnnotationPresent(ColumnName.class)) {
WColumn.setName(field.getName()); WColumn.setName(field.getName());
@ -110,7 +114,7 @@ public class WSheet<T> implements Serializable, Cloneable {
${basePackage}.frame.excel.annotation.Converter converter = field.getAnnotation(${basePackage}.frame.excel.annotation.Converter.class); ${basePackage}.frame.excel.annotation.Converter converter = field.getAnnotation(${basePackage}.frame.excel.annotation.Converter.class);
Class target = converter.target(); Class target = converter.target();
try { try {
WColumn.setConverter((${basePackage}.frame.excel.converter.Converter) target.newInstance()); WColumn.setConverter((Converter) target.newInstance());
} catch (InstantiationException e) { } catch (InstantiationException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
@ -162,9 +166,6 @@ public class WSheet<T> implements Serializable, Cloneable {
* *
* *
* @param list * @param list
* @throws NoSuchMethodException
* @throws InvocationTargetException
* @throws IllegalAccessException
*/ */
public WSheet(List<T> list) { public WSheet(List<T> list) {
if (list == null || list.size() == 0) { if (list == null || list.size() == 0) {
@ -180,19 +181,7 @@ public class WSheet<T> implements Serializable, Cloneable {
continue; continue;
} }
Field field = column.getField(); Field field = column.getField();
String att = StringUtil.upperFirstWord(field.getName()); Method method = ClassUtil.setMethod(field.getName(), t.getClass(), field.getType());
Method method = null;
try {
// 尝试获取get方法
method = t.getClass().getMethod("get" + att);
} catch (NoSuchMethodException e) {
// 尝试获取is方法工具生成布尔值可能是is而不是get
try {
method = t.getClass().getMethod("is" + att);
} catch (NoSuchMethodException e1) {
LogUtil.w(field.getName()+"can not find get method");
}
}
try { try {
Object value = method.invoke(t); Object value = method.invoke(t);
if (null == value) { if (null == value) {
@ -315,17 +304,17 @@ public class WSheet<T> implements Serializable, Cloneable {
} }
try { try {
T t = transferOneObject(clazz, i); T t = clazz.newInstance();
List<String> validate = ValidationUtil.validate(t); List<String> errs = transferMap(row, t);
validate.addAll(validator != null ? validator.validate(t) : null); errs.addAll(ValidationUtil.validate(t));
if (validate.size() > 0) { errs.addAll(validator != null ? validator.validate(t) : Collections.emptyList());
for (String s : validate) { if (errs.size() > 0) {
for (String s : errs) {
row.addError(s); row.addError(s);
} }
} }
} catch (Exception e) { } catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace(); row.addError("模板对象默认构造函数错误");
row.addError("数据检查错误");
} }
} }
} }
@ -333,67 +322,38 @@ public class WSheet<T> implements Serializable, Cloneable {
/** /**
* *
* *
* @param clazz * @param row
* @param rowIndex * @param target
* @return * @return
* @throws IllegalAccessException
* @throws InstantiationException
* @throws NoSuchMethodException
* @throws InvocationTargetException
*/ */
public T transferOneObject(Class<T> clazz, int rowIndex) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { public List<String> transferMap(WRow row, T target) {
T object = clazz.newInstance(); List<String> err = new ArrayList<>();
ParentFirst parentFirstAnnotation = clazz.getAnnotation(ParentFirst.class); for (String key : row.keySet()) {
boolean parentFirst = parentFirstAnnotation != null && parentFirstAnnotation.value();
Field[] fields = ClassUtil.getFields(clazz, parentFirst);
Set<Field> set = new HashSet<>();
for (Field field : fields) {
set.add(field);
}
for (int j = 0; j < this.columnList.size(); j++) {
String key = this.columnList.get(j).getName();
for (WColumn column : columnList) { for (WColumn column : columnList) {
Field field = column.getField(); String name = column.getName();
ColumnName fieldColumnName = field.getAnnotation(ColumnName.class); Method setMethod = column.getSetMethod();
if (key.equals(fieldColumnName.value())) {
String att = StringUtil.upperFirstWord(field.getName()); if (key.equals(name)) {
WCell WCell = row.get(column.getName());
WCell WCell = this.rowList.get(rowIndex).get(column.getName());
if (null != WCell) { if (null != WCell) {
String value = WCell.getValue(); String value = WCell.getValue();
Method method = clazz.getMethod("set" + att, field.getType());
//获取转换器 //获取转换器
${basePackage}.frame.excel.converter.Converter converter = column.getConverter(); Converter converter = column.getConverter();
method.invoke(object, converter.convert(value)); try {
} setMethod.invoke(target, converter.convert(value));
break; } catch (ValueConverterException e) {
e.printStackTrace();
err.add(e.getMessage());
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
err.add("[" + setMethod.getName() + "]执行错误");
} }
} }
break;
} }
return object;
} }
/**
* DataTableTList<br/><br/>
* ,@Name<br/>
* DataTable<br/>
*
*
* @return T
* @see WColumn
*/
public List<T> transferList(Class<T> clazz) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
List<T> list = new ArrayList<>();
for (int i = 0; i < this.rowList.size(); i++) {
T object = transferOneObject(clazz, i);
list.add(object);
} }
return list; return err;
} }
/** /**
@ -508,7 +468,6 @@ public class WSheet<T> implements Serializable, Cloneable {
for (int j = 0; j < this.columnList.size(); j++) { for (int j = 0; j < this.columnList.size(); j++) {
WColumn column = this.columnList.get(j); WColumn column = this.columnList.get(j);
Field field = column.getField();
Cell firstCell = firstRow.createCell(j + offset); Cell firstCell = firstRow.createCell(j + offset);
String columnName = column.getName(); String columnName = column.getName();
XSSFRichTextString textString; XSSFRichTextString textString;
@ -522,13 +481,6 @@ public class WSheet<T> implements Serializable, Cloneable {
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(column.getDescription()).append("\n"); sb.append(column.getDescription()).append("\n");
// 添加数据说明信息。
if (field.isAnnotationPresent(ColumnDescription.class)) {
// 获取声明字段上的Description信息。
ColumnDescription columnDescription = field.getAnnotation(ColumnDescription.class);
sb.append(columnDescription.value());
sb.append("\n");
}
// 如果填写了注释信息 // 如果填写了注释信息
if (sb.length() > 1) { if (sb.length() > 1) {

@ -1,5 +1,7 @@
package ${basePackage}.frame.excel.converter; package ${basePackage}.frame.excel.converter;
import ${basePackage}.frame.excel.exception.ValueConverterException;
/** /**
* BooleanConverter - BooleanStringString * BooleanConverter - BooleanStringString
* *
@ -10,12 +12,28 @@ package ${basePackage}.frame.excel.converter;
public class BooleanConverter implements Converter<Boolean> { public class BooleanConverter implements Converter<Boolean> {
@Override @Override
public Boolean convert(String var) { public Boolean convert(String var) throws ValueConverterException {
try { if (null == var || "".equals(var)) {
return Boolean.parseBoolean(var);
} catch (Exception e) {
return false; return false;
} }
String lowerCase = var.toLowerCase();
if (lowerCase.matches("y|n")) {
return "y".equals(lowerCase);
} else if (lowerCase.matches("yes|no")) {
return "yes".equals(lowerCase);
} else if (lowerCase.matches("true|false")) {
return "true".equals(lowerCase);
} else if (lowerCase.matches("是|否")) {
return "是".equals(lowerCase);
} else if (lowerCase.matches("有|无")) {
return "有".equals(lowerCase);
} else if (lowerCase.matches("是|不是")) {
return "是".equals(lowerCase);
} else {
throw new ValueConverterException("[" + var + "] can not convert to Boolean");
}
} }
@Override @Override
@ -23,6 +41,6 @@ public class BooleanConverter implements Converter<Boolean> {
if (var == null) { if (var == null) {
return ""; return "";
} }
return String.valueOf(var); return var ? "Y" : "N";
} }
} }

@ -1,5 +1,7 @@
package ${basePackage}.frame.excel.converter; package ${basePackage}.frame.excel.converter;
import ${basePackage}.frame.excel.exception.ValueConverterException;
/** /**
* Converter - * Converter -
* *
@ -9,7 +11,7 @@ package ${basePackage}.frame.excel.converter;
*/ */
public interface Converter<T> { public interface Converter<T> {
T convert(String var); T convert(String var) throws ValueConverterException;
String string(T var); String string(T var);
} }

@ -0,0 +1,15 @@
package xyz.wbsite.frame.excel.exception;
/**
*
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class ValueConverterException extends Exception {
public ValueConverterException(String s) {
super(s);
}
}

@ -30,25 +30,6 @@ public class ClassUtil {
return fields; return fields;
} }
/**
* class
*
* @param clazz
* @return
*/
public static Field[] getClassFields(Class<?> clazz) {
List<Field> list = new ArrayList<Field>();
Field[] fields;
do {
fields = clazz.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
list.add(fields[i]);
}
clazz = clazz.getSuperclass();
} while (clazz != Object.class && clazz != null);
return list.toArray(fields);
}
/** /**
* *
* *
@ -62,40 +43,38 @@ public class ClassUtil {
/** /**
* GET * GET
* *
* @param name * @param name
* @param pojoClass * @param pojoClass POJO
* @return * @return
* @throws Exception
*/ */
public static Method getMethod(String name, Class<?> pojoClass) throws Exception { public static Method getMethod(String name, Class<?> pojoClass) throws RuntimeException {
StringBuffer getMethodName = new StringBuffer("get"); String getMethodName = "get" + StringUtil.upperFirstWord(name);
getMethodName.append(name.substring(0, 1).toUpperCase());
getMethodName.append(name.substring(1));
Method method = null;
try { try {
method = pojoClass.getMethod(getMethodName.toString()); return pojoClass.getMethod(getMethodName);
} catch (Exception e) { } catch (Exception e) {
method = pojoClass.getMethod( getMethodName = "is" + StringUtil.upperFirstWord(name);
getMethodName.toString().replace("get", "is") try {
); return pojoClass.getMethod(getMethodName);
} catch (NoSuchMethodException e1) {
throw new RuntimeException("can not find[" + name + "]method");
}
} }
return method;
} }
/** /**
* SET * SET
* *
* @param name * @param name
* @param pojoClass * @param pojoClass POJO
* @param type * @return
* @return
* @throws Exception
*/ */
public static Method getMethod(String name, Class<?> pojoClass, Class<?> type) throws Exception { public static Method setMethod(String name, Class<?> pojoClass, Class<?> type) {
StringBuffer getMethodName = new StringBuffer("set"); String setMethodName = "set" + StringUtil.upperFirstWord(name);
getMethodName.append(name.substring(0, 1).toUpperCase()); try {
getMethodName.append(name.substring(1)); return pojoClass.getMethod(setMethodName, type);
return pojoClass.getMethod(getMethodName.toString(), type); } catch (Exception e) {
return null;
}
} }
public static boolean isJavaClass(Field field) { public static boolean isJavaClass(Field field) {

@ -15,7 +15,7 @@ import ${basePackage}.frame.base.BaseEntity;
public class ${table.getCName()} extends BaseEntity { public class ${table.getCName()} extends BaseEntity {
<#list table.fields as field> <#list table.fields as field>
<#if !field.isSystem || field.fieldName == 'ID'> <#if !field.isSystem>
/** /**
* ${field.fieldName} - ${field.fieldComment?default("")} * ${field.fieldName} - ${field.fieldComment?default("")}
*/ */
@ -23,7 +23,7 @@ public class ${table.getCName()} extends BaseEntity {
</#if> </#if>
</#list> </#list>
<#list table.fields as field> <#list table.fields as field>
<#if !field.isSystem || field.fieldName == 'ID' > <#if !field.isSystem>
public ${field.fieldType.javaType()} ${field.getterName()}() { public ${field.fieldType.javaType()} ${field.getterName()}() {
return this.${field.getFName()}; return this.${field.getFName()};

@ -1,6 +1,9 @@
package ${basePackage}.module.system.ent; package ${basePackage}.module.system.ent;
import ${basePackage}.frame.base.BaseEntity; import ${basePackage}.frame.base.BaseEntity;
import ${basePackage}.frame.excel.annotation.ColumnDescription;
import ${basePackage}.frame.excel.annotation.ColumnName;
import ${basePackage}.frame.excel.annotation.SheetName;
/** /**
* DICT - * DICT -
@ -9,37 +12,34 @@ import ${basePackage}.frame.base.BaseEntity;
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2019-07-20
*/ */
@SheetName("字典")
public class Dict extends BaseEntity { public class Dict extends BaseEntity {
/**
* ID -
*/
private Long id;
/** /**
* DICT_NAME - * DICT_NAME -
*/ */
@ColumnName("字典名称")
@ColumnDescription("1-50长度的字典名称")
private String dictName; private String dictName;
/** /**
* DICT_CODE - * DICT_CODE -
*/ */
@ColumnName("字典代码")
@ColumnDescription("1-50长度的字典代码")
private String dictCode; private String dictCode;
/** /**
* VERSION - * VERSION -
*/ */
@ColumnName("字典版本号")
@ColumnDescription("字典版本号.例如:yyyy-MM-dd HH:mm:ss")
private String version; private String version;
/** /**
* VALID - * VALID -
*/ */
@ColumnName("是否有效")
@ColumnDescription("true/false")
private Boolean valid; private Boolean valid;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getDictName() { public String getDictName() {
return this.dictName; return this.dictName;
} }

@ -11,10 +11,6 @@ import ${basePackage}.frame.base.BaseEntity;
*/ */
public class DictItem extends BaseEntity { public class DictItem extends BaseEntity {
/**
* ID -
*/
private Long id;
/** /**
* DICT_ID - ID * DICT_ID - ID
*/ */
@ -36,14 +32,6 @@ public class DictItem extends BaseEntity {
*/ */
private Boolean valid; private Boolean valid;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDictId() { public Long getDictId() {
return this.dictId; return this.dictId;
} }

@ -2,9 +2,6 @@ package ${basePackage}.module.system.req;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import ${basePackage}.frame.base.BaseRequest; import ${basePackage}.frame.base.BaseRequest;
import ${basePackage}.frame.excel.annotation.ColumnDescription;
import ${basePackage}.frame.excel.annotation.ColumnName;
import ${basePackage}.frame.excel.annotation.SheetName;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -15,14 +12,11 @@ import javax.validation.constraints.NotNull;
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2019-07-20
*/ */
@SheetName("字典")
public class DictCreateRequest extends BaseRequest { public class DictCreateRequest extends BaseRequest {
/** /**
* *
*/ */
@ColumnName("字典名称")
@ColumnDescription("1-50长度的字典名称")
@NotEmpty(message = "字典名称不能为空") @NotEmpty(message = "字典名称不能为空")
@Length(min = 1, max = 50, message = "字典名称长度不合法(1-50)") @Length(min = 1, max = 50, message = "字典名称长度不合法(1-50)")
private String dictName; private String dictName;
@ -30,8 +24,6 @@ public class DictCreateRequest extends BaseRequest {
/** /**
* *
*/ */
@ColumnName("字典代码")
@ColumnDescription("1-50长度的字典代码")
@NotEmpty(message = "字典代码不能为空") @NotEmpty(message = "字典代码不能为空")
@Length(min = 1, max = 50, message = "字典代码长度不合法(1-50)") @Length(min = 1, max = 50, message = "字典代码长度不合法(1-50)")
private String dictCode; private String dictCode;
@ -39,8 +31,6 @@ public class DictCreateRequest extends BaseRequest {
/** /**
* *
*/ */
@ColumnName("字典版本号")
@ColumnDescription("字典版本号.例如:yyyy-MM-dd HH:mm:ss")
@NotEmpty(message = "字典版本号不能为空") @NotEmpty(message = "字典版本号不能为空")
@Length(min = 1, max = 50, message = "字典版本号长度不合法(1-50)") @Length(min = 1, max = 50, message = "字典版本号长度不合法(1-50)")
private String version; private String version;
@ -48,8 +38,6 @@ public class DictCreateRequest extends BaseRequest {
/** /**
* *
*/ */
@ColumnName("是否有效")
@ColumnDescription("true/false")
@NotNull(message = "是否有效不能为NULL") @NotNull(message = "是否有效不能为NULL")
private Boolean valid; private Boolean valid;

@ -413,6 +413,7 @@
onImport: function (item) { onImport: function (item) {
const file = item.target.files[0]; const file = item.target.files[0];
this.$ajax.imports(this.module, this.target, file); this.$ajax.imports(this.module, this.target, file);
this.$refs['excel'].value = ''
}, },
onExport: function () { onExport: function () {
this.$ajax.exports(this.module, this.target, this.vm); this.$ajax.exports(this.module, this.target, this.vm);

Loading…
Cancel
Save

Powered by TurnKey Linux.