Browse Source

限制申诉理由和审批意见字符数量

master
luogw 1 month ago
parent
commit
690274fb47
  1. 7
      src/main/java/com/project/appeal/domain/service/Impl/CheckAppealDomainServiceImpl.java

7
src/main/java/com/project/appeal/domain/service/Impl/CheckAppealDomainServiceImpl.java

@ -37,6 +37,10 @@ public class CheckAppealDomainServiceImpl implements CheckAppealDomainService {
if (ObjectUtil.isEmpty(appealDTO.getId()) && StringUtils.isBlank(appealDTO.getRemark())){
throw new MissingParameterException("缺少申诉理由");
}
if (appealDTO.getRemark().length() > 500){
throw new MissingParameterException("申诉理由不能超过500字符");
}
if (ObjectUtil.isEmpty(appealDTO.getId()) && !appealDTO.getStatus().equals(AppealStatusEnum.PENDING_REVIEW.getValue())){
throw new BusinessErrorException("申诉状态错误");
}
@ -46,6 +50,9 @@ public class CheckAppealDomainServiceImpl implements CheckAppealDomainService {
if (!appealDTO.getStatus().equals(AppealStatusEnum.PENDING_REVIEW.getValue()) && StringUtils.isBlank(appealDTO.getReason())){
throw new BusinessErrorException("缺少审批意见");
}
if (appealDTO.getReason().length() > 500){
throw new MissingParameterException("审批意见不能超过500字符");
}
//校验题目是否以申诉过
if (ObjectUtil.isEmpty(appealDTO.getId()) ){
QueryWrapper<AppealEntity> entityQueryWrapper = new QueryWrapper<>();

Loading…
Cancel
Save