fix bug 40551 会议详情--新增-是否需要送站选择是后,新出现的三个字段有以下问题
This commit is contained in:
+5
-9
@@ -7,7 +7,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.Validation;
|
||||
import javax.validation.Validator;
|
||||
import javax.validation.groups.Default;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -47,7 +46,7 @@ public class ValidUtil {
|
||||
msg.append(constraintViolation.getMessage()).append(",");
|
||||
}
|
||||
if (StringUtils.isNotBlank(msg)) {
|
||||
throw new JeroBootException(msg.toString());
|
||||
throw new JeroBootException(msg.substring(0,msg.length()-1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,16 +57,13 @@ public class ValidUtil {
|
||||
* @param groups 待校验的组
|
||||
* @return errorList
|
||||
*/
|
||||
public static String validateReturnList(Object object, Class<?>... groups){
|
||||
StringBuilder msg = new StringBuilder();
|
||||
public static List<String> validateReturnList(Object object, Class<?>... groups){
|
||||
List<String> list = new ArrayList<>();
|
||||
Set<ConstraintViolation<Object>> set = validator.validate(object, groups);
|
||||
for (ConstraintViolation<Object> constraintViolation : set) {
|
||||
msg.append(constraintViolation.getMessage()).append(",");
|
||||
list.add(constraintViolation.getMessage());
|
||||
}
|
||||
if (msg.length()>0){
|
||||
return msg.substring(0,msg.length()-1);
|
||||
}
|
||||
return msg.toString();
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+10
-7
@@ -790,34 +790,37 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
//合作伙伴嘉宾只有最基础的参数所以不需要校验,只需要校验VIP,演讲嘉宾,特邀嘉宾
|
||||
if (!guestType.equals(MeetingSubitemCommon.COOPERATIVE)) {
|
||||
//先校验VIP,演讲嘉宾,特邀嘉宾的公共字段
|
||||
ValidUtil.validate(internationalGuestVO);
|
||||
List<String> validateReturnList = ValidUtil.validateReturnList(internationalGuestVO);
|
||||
//用餐
|
||||
Integer haveMeals = internationalGuestVO.getHaveMeals();
|
||||
if (haveMeals.equals(MeetingSubitemCommon.HAVE_MEALS)) {
|
||||
ValidUtil.validate(internationalGuestVO, HaveMeals.class);
|
||||
validateReturnList.addAll(ValidUtil.validateReturnList(internationalGuestVO, HaveMeals.class));
|
||||
}
|
||||
//接站
|
||||
Integer pickUp = internationalGuestVO.getPickUp();
|
||||
if (pickUp.equals(MeetingSubitemCommon.PICK_UP)) {
|
||||
ValidUtil.validate(internationalGuestVO, PickUp.class);
|
||||
validateReturnList.addAll(ValidUtil.validateReturnList(internationalGuestVO, PickUp.class));
|
||||
}
|
||||
//送站
|
||||
Integer deliveryStation = internationalGuestVO.getDeliveryStation();
|
||||
if (deliveryStation.equals(MeetingSubitemCommon.DELIVERY_STATION)) {
|
||||
ValidUtil.validate(internationalGuestVO, DeliveryStation.class);
|
||||
validateReturnList.addAll(ValidUtil.validateReturnList(internationalGuestVO, DeliveryStation.class));
|
||||
}
|
||||
//校验VIP,演讲嘉宾的公共字段
|
||||
if (!guestType.equals(MeetingSubitemCommon.GUEST)) {
|
||||
ValidUtil.validate(internationalGuestVO, Guest.class);
|
||||
validateReturnList.addAll(ValidUtil.validateReturnList(internationalGuestVO, Guest.class));
|
||||
//校验VIP
|
||||
if (guestType.equals(MeetingSubitemCommon.VIP)) {
|
||||
ValidUtil.validate(internationalGuestVO, VIP.class);
|
||||
validateReturnList.addAll(ValidUtil.validateReturnList(internationalGuestVO, VIP.class));
|
||||
Integer checkInHotel = internationalGuestVO.getCheckInHotel();
|
||||
if (checkInHotel.equals(MeetingSubitemCommon.CHECK_IN_HOTEL)) {
|
||||
ValidUtil.validate(internationalGuestVO, CheckInHotel.class);
|
||||
validateReturnList.addAll(ValidUtil.validateReturnList(internationalGuestVO, CheckInHotel.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!validateReturnList.isEmpty()){
|
||||
throw new JeroBootException(StringUtils.strip(validateReturnList.toString(),"[]"));
|
||||
}
|
||||
}
|
||||
BeanUtils.copyProperties(internationalGuestVO, payMeetingSituation1);
|
||||
// 参会人
|
||||
|
||||
@@ -140,12 +140,14 @@ public class InternationalGuestVO {
|
||||
@Excel(name = "离开站", width = 15)
|
||||
@ApiModelProperty(value = "离开站")
|
||||
@Size(max = 50,message = "离开站最大为50字符",groups = DeliveryStation.class)
|
||||
@NotBlank(message = "离开站不能为空",groups = DeliveryStation.class)
|
||||
private String departureStation;
|
||||
|
||||
/**离开班次*/
|
||||
@Excel(name = "离开班次", width = 15)
|
||||
@ApiModelProperty(value = "离开班次")
|
||||
@Size(max = 50,message = "离开班次最大为50字符",groups = DeliveryStation.class)
|
||||
@NotBlank(message = "离开班次不能为空",groups = DeliveryStation.class)
|
||||
private String departureShift;
|
||||
|
||||
/**同行人*/
|
||||
|
||||
+3
-3
@@ -417,9 +417,9 @@ public class SysDepartController {
|
||||
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
int lineNumber = num +1;
|
||||
try {
|
||||
String error = ValidUtil.validateReturnList(sysDepart);
|
||||
if (StringUtils.isNotBlank(error)){
|
||||
errorMessage.add("第 " + lineNumber + " 行:"+ error);
|
||||
List<String> errorList = ValidUtil.validateReturnList(sysDepart);
|
||||
if (!errorList.isEmpty()){
|
||||
errorMessage.add("第 " + lineNumber + " 行:"+ StringUtils.strip(errorList.toString(),"[]"));
|
||||
}
|
||||
LambdaQueryWrapper<SysDepart> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysDepart::getDepartName,sysDepart.getDepartName());
|
||||
|
||||
+3
-3
@@ -762,10 +762,10 @@ public class SysUserController {
|
||||
sysUser.setDelFlag(0);
|
||||
sysUser.setStatus(1);
|
||||
try {
|
||||
String error = ValidUtil.validateReturnList(sysUser);
|
||||
if (StringUtils.isNotBlank(error)){
|
||||
List<String> errorList = ValidUtil.validateReturnList(sysUser);
|
||||
if (!errorList.isEmpty()){
|
||||
errorLines++;
|
||||
errorMessage.add("第 " + lineNumber + " 行:"+ error);
|
||||
errorMessage.add("第 " + lineNumber + " 行:"+ StringUtils.strip(errorList.toString(),"[]"));
|
||||
}
|
||||
//处理邮箱和手机号的加密
|
||||
UserUtil.encryptUser(sysUser);
|
||||
|
||||
Reference in New Issue
Block a user