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