mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 12:52:07 +08:00
1、报表模板支持物理删除;2、登录页登录手机号检查支持忽略admin;
This commit is contained in:
+2
@@ -21,6 +21,8 @@ public @interface Mobile {
|
||||
|
||||
String message() default "手机号格式不正确,请重新确认";
|
||||
|
||||
String[] ignoreWhenCheck() default {};
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
+12
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.framework.common.validation;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.cf.imes.framework.common.util.validation.ValidationUtils;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
@@ -8,8 +9,19 @@ import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
public class MobileValidator implements ConstraintValidator<Mobile, String> {
|
||||
|
||||
private String[] ignoreWhenCheck;
|
||||
|
||||
@Override
|
||||
public void initialize(Mobile constraintAnnotation) {
|
||||
ConstraintValidator.super.initialize(constraintAnnotation);
|
||||
this.ignoreWhenCheck = constraintAnnotation.ignoreWhenCheck();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
||||
if (ArrayUtil.isNotEmpty(ignoreWhenCheck) && ArrayUtil.contains(ignoreWhenCheck, value)) {
|
||||
return true;
|
||||
}
|
||||
// 如果手机号为空,默认不校验,即校验通过
|
||||
if (CharSequenceUtil.isEmpty(value)) {
|
||||
return true;
|
||||
|
||||
+10
@@ -7,6 +7,7 @@ import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||
import com.cf.imes.module.report.controller.admin.template.vo.ReportTemplateSaveReqVO;
|
||||
import com.cf.imes.module.report.dal.dataobject.template.ReportTemplateDO;
|
||||
import com.cf.imes.module.report.enums.template.ReportTemplateTypeEnum;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -70,4 +71,13 @@ public interface ReportTemplateMapper extends BaseMapperX<ReportTemplateDO> {
|
||||
* @return
|
||||
*/
|
||||
int selectExistTemplateName(@Param("reqVO") ReportTemplateSaveReqVO reqVO, @Param("isSuperAdmin") boolean isSuperAdmin, @Param("type") Integer type);
|
||||
|
||||
/**
|
||||
* 根据id物理删除report_template
|
||||
*
|
||||
* @param id
|
||||
* @return 改动数量
|
||||
*/
|
||||
@Delete("DELETE FROM report_template WHERE id = #{id}")
|
||||
int physicalDeleteById(@Param("id") Long id);
|
||||
}
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ public class ReportTemplateServiceImpl implements ReportTemplateService {
|
||||
// 校验内置模板操作权限
|
||||
validateSystemTemplate(reportTemplateDO);
|
||||
// 删除
|
||||
templateMapper.deleteById(id);
|
||||
templateMapper.physicalDeleteById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public class AuthController {
|
||||
@OperateLog(enable = false)
|
||||
@Parameter(name = "mobile", description = "手机号", required = true)
|
||||
public CommonResult<Boolean> loginCheck(
|
||||
@Param("mobile") @NotEmpty(message = "手机号不能为空") @Mobile String mobile) {
|
||||
@Param("mobile") @NotEmpty(message = "手机号不能为空") @Mobile(ignoreWhenCheck = {"admin"}) String mobile) {
|
||||
return success(authService.loginCheck(mobile));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user