修改bug#40997
This commit is contained in:
@@ -104,4 +104,23 @@ public class ValidUtil {
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
/**
|
||||
* @Description 校验excel 每行数据格式(只用于支出合同导入校验)
|
||||
* @Author lqt
|
||||
* @Date 2021/8/26
|
||||
* @Param count excel 行数
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
public static StringBuilder validateSpendingContractExcel(Object object, int count,int num){
|
||||
StringBuilder msg = new StringBuilder();
|
||||
Set<ConstraintViolation<Object>> set = validatorAll.validate(object);
|
||||
if(set != null && set.size() > 0 ){
|
||||
for(ConstraintViolation<Object> constraintViolation : set){
|
||||
// 这里循环获取错误信息,可以自定义格式
|
||||
msg.append("第").append(count).append("行:").append(num).append(constraintViolation.getMessage()).append(",请修改!<br/>");
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user