修改市场法规清单必填项
This commit is contained in:
@@ -196,6 +196,8 @@ public class ResultCommon {
|
||||
public static final String STANDARD_NUMBER_ALREADY_EXISTS = "standard.number.already.exists";
|
||||
// {0}格式错误
|
||||
public static final String FORMATTING_ERROR = "formatting.error";
|
||||
// {0}数据不匹配
|
||||
public static final String DATA_MISMATCH = "data.mismatch";
|
||||
// {0}数据不存在
|
||||
public static final String DATA_DOES_NOT_EXIST = "data.does.not.exist";
|
||||
// 第{0}行
|
||||
|
||||
-3
@@ -102,7 +102,6 @@ public class LawsMarketStandardDetail implements Serializable {
|
||||
* 新生产车实施日期
|
||||
*/
|
||||
@Excel(name = "新生产车实施日期", width = 15)
|
||||
@NotBlank(message = "新生产车实施日期不能为空")
|
||||
@ApiModelProperty(value = "新生产车实施日期")
|
||||
private String newProductImplDate;
|
||||
|
||||
@@ -110,7 +109,6 @@ public class LawsMarketStandardDetail implements Serializable {
|
||||
* 新认证车实施日期
|
||||
*/
|
||||
@Excel(name = "新认证车实施日期", width = 15)
|
||||
@NotBlank(message = "新认证车实施日期不能为空")
|
||||
@ApiModelProperty(value = "新认证车实施日期")
|
||||
private String newAuthImplDate;
|
||||
|
||||
@@ -118,7 +116,6 @@ public class LawsMarketStandardDetail implements Serializable {
|
||||
* 注册日期
|
||||
*/
|
||||
@Excel(name = "注册日期", width = 15)
|
||||
@NotBlank(message = "注册日期不能为空")
|
||||
@ApiModelProperty(value = "注册日期")
|
||||
private String registrationDate;
|
||||
|
||||
|
||||
+3
-3
@@ -287,7 +287,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
|
||||
// 验证标准名称
|
||||
if(!Objects.equals(obj.getStandardName(),p.getStandardName())){
|
||||
String name = ValidUtil.getAnnotation(LawsMarketStandardDetail.class,"standardName");
|
||||
s.append(MessageUtils.getMessage(ResultCommon.FORMATTING_ERROR,name)).append(",");
|
||||
s.append(MessageUtils.getMessage(ResultCommon.DATA_MISMATCH,name)).append(",");
|
||||
}
|
||||
// 验证标准英文名称
|
||||
appendStandardEnglishName(p, s, obj);
|
||||
@@ -296,7 +296,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
|
||||
if(!Objects.equals(StringUtils.isEmpty(obj.getType()) ? "" : obj.getType(),
|
||||
StringUtils.isEmpty(p.getType()) ? "" : p.getType())){
|
||||
String name = ValidUtil.getAnnotation(LawsMarketStandardDetail.class,"type");
|
||||
s.append(MessageUtils.getMessage(ResultCommon.FORMATTING_ERROR,name)).append(",");
|
||||
s.append(MessageUtils.getMessage(ResultCommon.DATA_MISMATCH,name)).append(",");
|
||||
}
|
||||
}
|
||||
listStandardIdRepeat.add(id);
|
||||
@@ -306,7 +306,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
|
||||
if(!Objects.equals(StringUtils.isEmpty(obj.getStandardEnglishName()) ? "" : obj.getStandardEnglishName(),
|
||||
StringUtils.isEmpty(p.getStandardEnglishName()) ? "" : p.getStandardEnglishName())){
|
||||
String name = ValidUtil.getAnnotation(LawsMarketStandardDetail.class,"standardEnglishName");
|
||||
s.append(MessageUtils.getMessage(ResultCommon.FORMATTING_ERROR,name)).append(",");
|
||||
s.append(MessageUtils.getMessage(ResultCommon.DATA_MISMATCH,name)).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ValidUtil {
|
||||
if(set != null && set.size() >0 ){
|
||||
Field[] fields = object.getClass().getDeclaredFields();
|
||||
setField(object, fields);
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
// Locale locale = LocaleContextHolder.getLocale();
|
||||
for (Field field : fields) {
|
||||
for(ConstraintViolation<Object> constraintViolation : set){
|
||||
if(Objects.equals(constraintViolation.getPropertyPath().toString(),field.getName())){
|
||||
@@ -166,7 +166,7 @@ public class ValidUtil {
|
||||
*/
|
||||
public static String getAnnotation(Class<?> clazz, String fieldName) {
|
||||
try {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
// Locale locale = LocaleContextHolder.getLocale();
|
||||
// 获取字段
|
||||
Field field = clazz.getDeclaredField(fieldName);
|
||||
// 检查字段是否有 MyAnnotation 注解
|
||||
@@ -174,10 +174,10 @@ public class ValidUtil {
|
||||
// 获取注解实例
|
||||
Excel annotation = field.getAnnotation(Excel.class);
|
||||
String name = annotation.name();
|
||||
String[] str1 = name.split("\\(");
|
||||
String en = str1.length > 1 ? str1[1].split("\\)")[0] : str1[0];
|
||||
String zh = str1[0];
|
||||
name = Objects.equals(locale,Locale.ENGLISH) ? en : zh;
|
||||
// String[] str1 = name.split("\\(");
|
||||
// String en = str1.length > 1 ? str1[1].split("\\)")[0] : str1[0];
|
||||
// String zh = str1[0];
|
||||
// name = Objects.equals(locale,Locale.ENGLISH) ? en : zh;
|
||||
return name;
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
|
||||
@@ -107,3 +107,4 @@ can_not_find_template_file=Can not find template file name {0}
|
||||
can_not_find_field=Can not find field {0}
|
||||
tag.add.error.1=The attribute name is too long
|
||||
tree.node.exists=Name {0} tree node exists
|
||||
data.mismatch={0} Data mismatch
|
||||
|
||||
@@ -106,3 +106,4 @@ can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u
|
||||
can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5
|
||||
tag.add.error.1=\u5C5E\u6027\u540D\u79F0\u592A\u957F
|
||||
tree.node.exists=\u5DF2\u5B58\u5728\u540D\u4E3A"{0}"\u7684\u8282\u70B9"
|
||||
data.mismatch={0}\u6570\u636E\u4E0D\u5339\u914D
|
||||
|
||||
Reference in New Issue
Block a user