diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java index e3e4afb7..0f7b1b51 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java @@ -230,7 +230,7 @@ public class NoticeService { noticeVisibleRange.setDataName(employeeEntity == null ? StringConst.EMPTY : employeeEntity.getActualName()); } else { DepartmentVO departmentVO = departmentService.getDepartmentById(noticeVisibleRange.getDataId()); - noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getName()); + noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getDepartmentName()); } } updateFormVO.setVisibleRangeList(noticeVisibleRangeList); diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java index a76ea7e9..4d52bb16 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java @@ -31,7 +31,7 @@ public class DepartmentEntity { /** * 部门名称 */ - private String name; + private String departmentName; /** * 负责人员工 id diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java index f7f92c27..1cba929a 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java @@ -20,7 +20,7 @@ public class DepartmentAddForm { @Schema(description = "部门名称") @Length(min = 1, max = 50, message = "请输入正确的部门名称(1-50个字符)") @NotNull(message = "请输入正确的部门名称(1-50个字符)") - private String name; + private String departmentName; @Schema(description = "排序") @NotNull(message = "排序值") diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java index c973a959..43b2a355 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java @@ -24,7 +24,7 @@ public class DepartmentVO implements Serializable { private Long departmentId; @Schema(description = "部门名称") - private String name; + private String departmentName; @Schema(description = "部门负责人姓名") private String managerName; diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java index d829d355..810d2ffe 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java @@ -97,15 +97,15 @@ public class DepartmentCacheManager { */ private String buildDepartmentPath(DepartmentVO departmentVO, Map departmentMap) { if (Objects.equals(departmentVO.getParentId(), NumberUtils.LONG_ZERO)) { - return departmentVO.getName(); + return departmentVO.getDepartmentName(); } //父节点 DepartmentVO parentDepartment = departmentMap.get(departmentVO.getParentId()); if (parentDepartment == null) { - return departmentVO.getName(); + return departmentVO.getDepartmentName(); } String pathName = buildDepartmentPath(parentDepartment, departmentMap); - return pathName + "/" + departmentVO.getName(); + return pathName + "/" + departmentVO.getDepartmentName(); } // ---------------------- 构造树的一些方法 ------------------------------ diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java index 3c38e705..9ef2fbfc 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java @@ -14,10 +14,7 @@ import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.common.util.SmartBeanUtil; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import java.util.Map; /** * 部门 service diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java index 69e79891..65352b58 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java @@ -242,8 +242,6 @@ public class EmployeeService { /** * 更新登录人头像 * - * @param employeeUpdateAvatarForm - * @return */ public ResponseDTO updateAvatar(EmployeeUpdateAvatarForm employeeUpdateAvatarForm) { Long employeeId = employeeUpdateAvatarForm.getEmployeeId(); @@ -395,7 +393,7 @@ public class EmployeeService { List voList = employeeEntityList.stream().map(e -> { EmployeeVO employeeVO = SmartBeanUtil.copy(e, EmployeeVO.class); if (department != null) { - employeeVO.setDepartmentName(department.getName()); + employeeVO.setDepartmentName(department.getDepartmentName()); } return employeeVO; }).collect(Collectors.toList()); diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/RequestEmployee.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/RequestEmployee.java index 0b61e3d2..783ae444 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/RequestEmployee.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/RequestEmployee.java @@ -7,6 +7,8 @@ import net.lab1024.sa.base.common.enumeration.GenderEnum; import net.lab1024.sa.base.common.enumeration.UserTypeEnum; import net.lab1024.sa.base.common.swagger.SchemaEnum; +import java.io.Serializable; + /** * 请求员工登录信息 * @@ -17,7 +19,7 @@ import net.lab1024.sa.base.common.swagger.SchemaEnum; * @Copyright 1024创新实验室 */ @Data -public class RequestEmployee implements RequestUser { +public class RequestEmployee implements RequestUser, Serializable { @Schema(description = "员工id") private Long employeeId; diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java index 8fdc9a1d..434e4eca 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java @@ -88,7 +88,7 @@ public class LoginManager { // 部门信息 DepartmentVO department = departmentService.getDepartmentById(employeeEntity.getDepartmentId()); - requestEmployee.setDepartmentName(null == department ? StringConst.EMPTY : department.getName()); + requestEmployee.setDepartmentName(null == department ? StringConst.EMPTY : department.getDepartmentName()); // 头像信息 String avatar = employeeEntity.getAvatar(); diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java index 290e4f3f..53515aef 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java @@ -15,6 +15,7 @@ import net.lab1024.sa.base.common.code.SystemErrorCode; import net.lab1024.sa.base.common.domain.RequestUrlVO; import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.common.util.SmartBeanUtil; +import net.lab1024.sa.base.common.util.SmartStringUtil; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -134,6 +135,10 @@ public class MenuService { * @return true 重复 false 未重复 */ public Boolean validateWebPerms(T menuDTO) { + if(SmartStringUtil.isEmpty(menuDTO.getWebPerms())){ + return false; + } + MenuEntity menu = menuDao.getByWebPerms(menuDTO.getWebPerms(), Boolean.FALSE); if (menuDTO instanceof MenuAddForm) { return menu != null; diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java index 28775702..d4d2dc4f 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java @@ -5,7 +5,6 @@ import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; -import java.util.List; import java.util.Set; /** diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java index d77f364f..05481c03 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java @@ -73,7 +73,7 @@ public class RoleEmployeeService { List departmentIdList = employeeList.stream().filter(e -> e != null && e.getDepartmentId() != null).map(EmployeeVO::getDepartmentId).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(departmentIdList)) { List departmentEntities = departmentDao.selectBatchIds(departmentIdList); - Map departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getName)); + Map departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getDepartmentName)); employeeList.forEach(e -> { e.setDepartmentName(departmentIdNameMap.getOrDefault(e.getDepartmentId(), StringConst.EMPTY)); }); diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminProtectController.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminProtectController.java index 69f7e3fa..49780a34 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminProtectController.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminProtectController.java @@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; /** - * * 网络安全 * * @Author 1024创新实验室-主任:卓大 diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml b/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml index 62acf08f..ba1a417f 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml @@ -70,7 +70,7 @@ select t_notice_view_record.*, t_employee.actual_name as employeeName, - t_department.name as departmentName + t_department.department_name from t_notice_view_record left join t_employee on t_employee.employee_id = t_notice_view_record.employee_id left join t_department on t_department.department_id = t_employee.department_id diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml b/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml index 8ee2974d..939008a3 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml @@ -6,7 +6,7 @@ SELECT t_employee.*, - t_department.name AS departmentName + t_department.department_name FROM t_employee LEFT JOIN t_department ON t_department.department_id = t_employee.department_id @@ -169,7 +169,7 @@ SELECT t_employee.*, - t_department.name AS departmentName + t_department.department_name FROM t_employee LEFT JOIN t_department ON t_department.department_id = t_employee.department_id diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/common/controller/SupportBaseController.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/common/controller/SupportBaseController.java index 4449af25..6f0a28d5 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/common/controller/SupportBaseController.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/common/controller/SupportBaseController.java @@ -3,6 +3,7 @@ package net.lab1024.sa.base.common.controller; import net.lab1024.sa.base.constant.SwaggerTagConst; import org.springframework.web.bind.annotation.RequestMapping; + /** * 支撑类业务路由基类 * diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java index 356b082c..c1440361 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java @@ -28,7 +28,8 @@ public class CacheConfig { return RedisCacheConfiguration.defaultCacheConfig() .disableCachingNullValues() .computePrefixWith(name -> "cache:" + name + ":") - .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer())); +// .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer())); + ; } @Bean diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java index d0bf74b9..3361a8de 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java @@ -28,7 +28,7 @@ public class ChangeLogEntity { /** * 版本 */ - private String version; + private String updateVersion; /** * 更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java index 22979b2f..f1971462 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java @@ -23,7 +23,7 @@ public class ChangeLogAddForm { @Schema(description = "版本", required = true) @NotBlank(message = "版本 不能为空") - private String version; + private String updateVersion; @SchemaEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误", required = true) diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java index a907a234..eaa5414d 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java @@ -27,7 +27,7 @@ public class ChangeLogUpdateForm { @Schema(description = "版本", required = true) @NotBlank(message = "版本 不能为空") - private String version; + private String updateVersion; @SchemaEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误", required = true) diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java index e8930d0f..10270f42 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java @@ -23,7 +23,7 @@ public class ChangeLogVO { private Long changeLogId; @Schema(description = "版本") - private String version; + private String updateVersion; @SchemaEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") private Integer type; diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java index b8d2047b..61e0971b 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java @@ -44,7 +44,7 @@ public class ChangeLogService { * 添加 */ public synchronized ResponseDTO add(ChangeLogAddForm addForm) { - ChangeLogEntity existVersion = changeLogDao.selectByVersion(addForm.getVersion()); + ChangeLogEntity existVersion = changeLogDao.selectByVersion(addForm.getUpdateVersion()); if (existVersion != null) { return ResponseDTO.userErrorParam("此版本已经存在"); } @@ -58,7 +58,7 @@ public class ChangeLogService { * 更新 */ public synchronized ResponseDTO update(ChangeLogUpdateForm updateForm) { - ChangeLogEntity existVersion = changeLogDao.selectByVersion(updateForm.getVersion()); + ChangeLogEntity existVersion = changeLogDao.selectByVersion(updateForm.getUpdateVersion()); if (existVersion != null && !updateForm.getChangeLogId().equals(existVersion.getChangeLogId())) { return ResponseDTO.userErrorParam("此版本已经存在"); } diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java index 1b2fe58c..c0f436dd 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java @@ -11,16 +11,6 @@ package net.lab1024.sa.base.module.support.codegenerator.constant; */ public class CodeGeneratorConstant { - /** - * 主键 - */ - public final static String PRIMARY_KEY = "PRI"; - - /** - * 自增 - */ - public final static String AUTO_INCREMENT = "auto_increment"; - /** * 默认逻辑删除字段名称 */ diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java index b28c39ec..0fa76e5c 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java @@ -23,20 +23,26 @@ public class TableColumnVO { @Schema(description = "列描述") private String columnComment; - @Schema(description = "columnKey") - private String columnKey; - - @Schema(description = "extra") - private String extra; - - @Schema(description = "是否为空") - private String isNullable; - @Schema(description = "数据类型varchar") private String dataType; - @Schema(description = "列类型varchar(50)") - private String columnType; + @Schema(description = "是否为空") + private Boolean nullableFlag; + @Schema(description = "是否为主键") + private Boolean primaryKeyFlag; + @Schema(description = "是否递增") + private Boolean autoIncreaseFlag; + + // --------------- 临时字段 ------------------- + + @Schema(hidden = true) + private String columnKey; + + @Schema(hidden = true) + private String extra; + + @Schema(hidden = true) + private String isNullable; } diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java index e872c7be..213553a8 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java @@ -160,6 +160,16 @@ public class DataTracerChangeContentService { return "【原数据】:
" + oldContent + "
" + "【新数据】:
" + newContent; } + /** + * 解析批量bean的内容 + * + * @param objectList 对象列表 + * @return 单个内容 + */ + public String getChangeContent(List objectList) { + return this.getObjectListContent(objectList); + } + /** * 获取一个对象的内容信息 * diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java index 3b6a2ccf..bf36ccb8 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java @@ -43,7 +43,6 @@ public class HelpDocCatalogEntity { /** * 排序 */ - @TableField("`sort`") private Integer sort; diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java index 6dd02387..b19542c3 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java @@ -53,7 +53,6 @@ public class HelpDocEntity { /** * 排序 */ - @TableField("`sort`") private Integer sort; /** diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java index d000d243..18fac72a 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java @@ -47,7 +47,7 @@ import java.util.Map; @Component public class MailService { - @Autowired + @Resource private JavaMailSender javaMailSender; @Resource diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java index 00cb51ed..ccbfef54 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import jakarta.annotation.PostConstruct; import jakarta.annotation.Resource; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.module.support.config.ConfigKeyEnum; @@ -28,17 +29,29 @@ public class Level3ProtectConfigService { /** * 开启双因子登录,默认:开启 + * -- GETTER -- + * 开启双因子登录,默认:开启 + */ + @Getter private boolean twoFactorLoginEnabled = false; /** * 连续登录失败次数则锁定,-1表示不受限制,可以一直尝试登录 + * -- GETTER -- + * 连续登录失败次数则锁定,-1表示不受限制,可以一直尝试登录 + */ + @Getter private int loginFailMaxTimes = -1; /** * 连续登录失败锁定时间(单位:秒),-1表示不锁定,建议锁定30分钟 + * -- GETTER -- + * 连续登录失败锁定时间(单位:秒),-1表示不锁定,建议锁定30分钟 + */ + @Getter private int loginFailLockSeconds = 1800; /** @@ -48,61 +61,53 @@ public class Level3ProtectConfigService { /** * 密码复杂度 是否开启,默认:开启 + * -- GETTER -- + * 密码复杂度 是否开启,默认:开启 + */ + @Getter private boolean passwordComplexityEnabled = true; /** * 定期修改密码时间间隔(默认:天),默认:建议90天更换密码 + * -- GETTER -- + * 定期修改密码时间间隔(默认:天),默认:建议90天更换密码 + */ + @Getter private int regularChangePasswordDays = 90; /** * 定期修改密码不允许相同次数,默认:3次以内密码不能相同 + * -- GETTER -- + * 定期修改密码不允许相同次数,默认:3次以内密码不能相同 + */ + @Getter private int regularChangePasswordNotAllowRepeatTimes = 3; /** * 文件大小限制,单位 mb ,(默认:50 mb) + * -- GETTER -- + * 文件大小限制,单位 mb ,(默认:50 mb) + */ + @Getter private long maxUploadFileSizeMb = 50; /** * 文件检测,默认:不开启 + * -- GETTER -- + * 文件检测,默认:不开启 + */ + @Getter private boolean fileDetectFlag = false; @Resource private ConfigService configService; - /** - * 文件检测,默认:不开启 - */ - public boolean isFileDetectFlag() { - return fileDetectFlag; - } - - /** - * 文件大小限制,单位 mb ,(默认:50 mb) - */ - public long getMaxUploadFileSizeMb() { - return maxUploadFileSizeMb; - } - - /** - * 连续登录失败次数则锁定,-1表示不受限制,可以一直尝试登录 - */ - public int getLoginFailMaxTimes() { - return loginFailMaxTimes; - } - - /** - * 连续登录失败锁定时间(单位:秒),-1表示不锁定,建议锁定30分钟 - */ - public int getLoginFailLockSeconds() { - return loginFailLockSeconds; - } - /** * 最低活跃时间(单位:秒),超过此时间没有操作系统就会被冻结,默认-1 代表不限制,永不冻结; 默认 30分钟 */ @@ -110,34 +115,6 @@ public class Level3ProtectConfigService { return loginActiveTimeoutSeconds > 0 ? loginActiveTimeoutSeconds : -1; } - /** - * 定期修改密码时间间隔(默认:天),默认:建议90天更换密码 - */ - public int getRegularChangePasswordDays() { - return regularChangePasswordDays; - } - - /** - * 开启双因子登录,默认:开启 - */ - public boolean isTwoFactorLoginEnabled() { - return twoFactorLoginEnabled; - } - - /** - * 密码复杂度 是否开启,默认:开启 - */ - public boolean isPasswordComplexityEnabled() { - return passwordComplexityEnabled; - } - - /** - * 定期修改密码不允许相同次数,默认:3次以内密码不能相同 - */ - public int getRegularChangePasswordNotAllowRepeatTimes() { - return regularChangePasswordNotAllowRepeatTimes; - } - @PostConstruct void init() { String configValue = configService.getConfigValue(ConfigKeyEnum.LEVEL3_PROTECT_CONFIG); diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/SecurityPasswordService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/SecurityPasswordService.java index 3cd83058..5ae0a3ad 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/SecurityPasswordService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/SecurityPasswordService.java @@ -6,7 +6,6 @@ import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.common.util.SmartStringUtil; import net.lab1024.sa.base.module.support.securityprotect.dao.PasswordLogDao; import net.lab1024.sa.base.module.support.securityprotect.domain.PasswordLogEntity; -import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.RandomStringUtils; import org.springframework.security.crypto.argon2.Argon2PasswordEncoder; import org.springframework.stereotype.Service; diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java index baa912b4..fce5e110 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java @@ -11,6 +11,8 @@ import net.lab1024.sa.base.module.support.serialnumber.dao.SerialNumberDao; import net.lab1024.sa.base.module.support.serialnumber.dao.SerialNumberRecordDao; import net.lab1024.sa.base.module.support.serialnumber.domain.*; import org.apache.commons.lang3.RandomUtils; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; import java.time.LocalDateTime; @@ -92,6 +94,7 @@ public abstract class SerialNumberBaseService implements SerialNumberService { public abstract void initLastGenerateData(List serialNumberEntityList); @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) public String generate(SerialNumberIdEnum serialNumberIdEnum) { List generateList = this.generate(serialNumberIdEnum, 1); if (generateList == null || generateList.isEmpty()) { @@ -101,6 +104,7 @@ public abstract class SerialNumberBaseService implements SerialNumberService { } @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) public List generate(SerialNumberIdEnum serialNumberIdEnum, int count) { SerialNumberInfoBO serialNumberInfoBO = serialNumberMap.get(serialNumberIdEnum.getSerialNumberId()); if (serialNumberInfoBO == null) { diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java index 571e0d94..b70f8b24 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java @@ -60,22 +60,24 @@ public class SerialNumberRedisService extends SerialNumberBaseService { public List generateSerialNumberList(SerialNumberInfoBO serialNumberInfo, int count) { SerialNumberGenerateResultBO serialNumberGenerateResult = null; String lockKey = RedisKeyConst.Support.SERIAL_NUMBER + serialNumberInfo.getSerialNumberId(); - try { - boolean lock = false; - for (int i = 0; i < MAX_GET_LOCK_COUNT; i++) { - try { - lock = redisService.getLock(lockKey, 60 * 1000L); - if (lock) { - break; - } - Thread.sleep(SLEEP_MILLISECONDS); - } catch (Throwable e) { - log.error(e.getMessage(), e); + + boolean lock = false; + for (int i = 0; i < MAX_GET_LOCK_COUNT; i++) { + try { + lock = redisService.getLock(lockKey, 60 * 1000L); + if (lock) { + break; } + Thread.sleep(SLEEP_MILLISECONDS); + } catch (Throwable e) { + log.error(e.getMessage(), e); } - if (!lock) { - throw new BusinessException("SerialNumber 尝试5次,未能生成单号"); - } + } + if (!lock) { + throw new BusinessException("SerialNumber 尝试5次,未能生成单号"); + } + + try { // 获取上次的生成结果 SerialNumberLastGenerateBO lastGenerateBO = (SerialNumberLastGenerateBO) redisService.mget( RedisKeyConst.Support.SERIAL_NUMBER_LAST_INFO, diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/dev/sa-base.yaml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/dev/sa-base.yaml index 400b9780..d6802f47 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/dev/sa-base.yaml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/dev/sa-base.yaml @@ -67,7 +67,7 @@ spring: # 缓存实现类型 cache: - type: caffeine + type: redis # tomcat 配置,主要用于 配置 访问日志(便于将来排查错误) server: diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml index 09136785..126951f4 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml @@ -14,7 +14,7 @@ - AND ( INSTR(t_change_log.version,#{queryForm.keyword}) + AND ( INSTR(t_change_log.update_version,#{queryForm.keyword}) OR INSTR(t_change_log.publish_author,#{queryForm.keyword}) OR INSTR(t_change_log.content,#{queryForm.keyword}) ) @@ -35,12 +35,12 @@ AND t_change_log.link = #{queryForm.link}
- order by t_change_log.version desc + order by t_change_log.update_version desc diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml index b2b88edc..cffb1b66 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml @@ -13,7 +13,7 @@ AND user_type = #{query.userType} - + AND INSTR(login_ip,#{query.ip}) @@ -25,9 +25,6 @@ AND INSTR(user_name,#{query.userName}) - - AND INSTR(login_ip,#{query.ip}) -
order by create_time desc @@ -37,9 +34,9 @@ * from t_login_log where - user_id = #{userId} - and user_type = #{userType} - and login_result = #{loginLogResult} + user_id = #{userId} + and user_type = #{userType} + and login_result = #{loginLogResult} order by login_log_id desc limit 1 diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml index fcf1d8e1..d00adff0 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml @@ -23,10 +23,10 @@ AND INSTR(operate_user_name,#{query.userName}) - AND (INSTR(`module`,#{query.keywords}) OR INSTR(content,#{query.keywords})) + AND (INSTR(module,#{query.keywords}) OR INSTR(content,#{query.keywords})) - AND (INSTR(`url`,#{query.requestKeywords}) OR INSTR(`method`,#{query.requestKeywords}) OR INSTR(`param`,#{query.requestKeywords})) + AND (INSTR(url,#{query.requestKeywords}) OR INSTR(method,#{query.requestKeywords}) OR INSTR(param,#{query.requestKeywords})) AND success_flag = #{query.successFlag} diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/pre/sa-base.yaml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/pre/sa-base.yaml index 2836bad0..d6802f47 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/pre/sa-base.yaml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/pre/sa-base.yaml @@ -134,7 +134,7 @@ reload: sa-token: # token 名称(同时也是 cookie 名称) token-name: Authorization - # token 前缀 例如:Bear + # token 前缀 例如:Bearer token-prefix: Bearer # token 有效期(单位:秒) 默认30天(2592000秒),-1 代表永久有效 timeout: 2592000 diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/prod/sa-base.yaml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/prod/sa-base.yaml index 4cef6a5e..2156faab 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/prod/sa-base.yaml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/prod/sa-base.yaml @@ -34,6 +34,7 @@ spring: min-idle: 10 max-idle: 50 max-wait: 30000ms + # 邮件,置以SSL的方式发送, 这个需要使用这种方式并且端口是465 mail: host: smtp.163.com @@ -106,7 +107,7 @@ springdoc: knife4j: enable: true basic: - enable: true + enable: false username: api # Basic认证用户名 password: 1024 # Basic认证密码 @@ -131,7 +132,7 @@ reload: sa-token: # token 名称(同时也是 cookie 名称) token-name: Authorization - # token 前缀 例如:Bear + # token 前缀 例如:Bearer token-prefix: Bearer # token 有效期(单位:秒) 默认30天(2592000秒),-1 代表永久有效 timeout: 2592000 diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/test/sa-base.yaml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/test/sa-base.yaml index 2836bad0..d6802f47 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/test/sa-base.yaml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/test/sa-base.yaml @@ -134,7 +134,7 @@ reload: sa-token: # token 名称(同时也是 cookie 名称) token-name: Authorization - # token 前缀 例如:Bear + # token 前缀 例如:Bearer token-prefix: Bearer # token 有效期(单位:秒) 默认30天(2592000秒),-1 代表永久有效 timeout: 2592000 diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java index a51f432f..516f35f9 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java @@ -230,7 +230,7 @@ public class NoticeService { noticeVisibleRange.setDataName(employeeEntity == null ? StringConst.EMPTY : employeeEntity.getActualName()); } else { DepartmentVO departmentVO = departmentService.getDepartmentById(noticeVisibleRange.getDataId()); - noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getName()); + noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getDepartmentName()); } } updateFormVO.setVisibleRangeList(noticeVisibleRangeList); diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java index a76ea7e9..4d52bb16 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java @@ -31,7 +31,7 @@ public class DepartmentEntity { /** * 部门名称 */ - private String name; + private String departmentName; /** * 负责人员工 id diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java index 25ecc447..760aafee 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java @@ -21,7 +21,7 @@ public class DepartmentAddForm { @Schema(description = "部门名称") @Length(min = 1, max = 50, message = "请输入正确的部门名称(1-50个字符)") @NotNull(message = "请输入正确的部门名称(1-50个字符)") - private String name; + private String departmentName; @Schema(description = "排序") @NotNull(message = "排序值") diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java index c973a959..43b2a355 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java @@ -24,7 +24,7 @@ public class DepartmentVO implements Serializable { private Long departmentId; @Schema(description = "部门名称") - private String name; + private String departmentName; @Schema(description = "部门负责人姓名") private String managerName; diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java index cf2bcb15..950a6f35 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java @@ -97,15 +97,15 @@ public class DepartmentCacheManager { */ private String buildDepartmentPath(DepartmentVO departmentVO, Map departmentMap) { if (Objects.equals(departmentVO.getParentId(), NumberUtils.LONG_ZERO)) { - return departmentVO.getName(); + return departmentVO.getDepartmentName(); } //父节点 DepartmentVO parentDepartment = departmentMap.get(departmentVO.getParentId()); if (parentDepartment == null) { - return departmentVO.getName(); + return departmentVO.getDepartmentName(); } String pathName = buildDepartmentPath(parentDepartment, departmentMap); - return pathName + "/" + departmentVO.getName(); + return pathName + "/" + departmentVO.getDepartmentName(); } // ---------------------- 构造树的一些方法 ------------------------------ diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java index a0bc7a0a..d2b97e50 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java @@ -242,8 +242,6 @@ public class EmployeeService { /** * 更新登录人头像 * - * @param employeeUpdateAvatarForm - * @return */ public ResponseDTO updateAvatar(EmployeeUpdateAvatarForm employeeUpdateAvatarForm) { Long employeeId = employeeUpdateAvatarForm.getEmployeeId(); @@ -395,7 +393,7 @@ public class EmployeeService { List voList = employeeEntityList.stream().map(e -> { EmployeeVO employeeVO = SmartBeanUtil.copy(e, EmployeeVO.class); if (department != null) { - employeeVO.setDepartmentName(department.getName()); + employeeVO.setDepartmentName(department.getDepartmentName()); } return employeeVO; }).collect(Collectors.toList()); diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java index e3b0c607..7dd41272 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java @@ -88,7 +88,7 @@ public class LoginManager { // 部门信息 DepartmentVO department = departmentService.getDepartmentById(employeeEntity.getDepartmentId()); - requestEmployee.setDepartmentName(null == department ? StringConst.EMPTY : department.getName()); + requestEmployee.setDepartmentName(null == department ? StringConst.EMPTY : department.getDepartmentName()); // 头像信息 String avatar = employeeEntity.getAvatar(); diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java index 548caf60..3dbf61f2 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java @@ -14,6 +14,7 @@ import net.lab1024.sa.base.common.code.SystemErrorCode; import net.lab1024.sa.base.common.domain.RequestUrlVO; import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.common.util.SmartBeanUtil; +import net.lab1024.sa.base.common.util.SmartStringUtil; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -134,6 +135,10 @@ public class MenuService { * @return true 重复 false 未重复 */ public Boolean validateWebPerms(T menuDTO) { + if(SmartStringUtil.isEmpty(menuDTO.getWebPerms())){ + return false; + } + MenuEntity menu = menuDao.getByWebPerms(menuDTO.getWebPerms(), Boolean.FALSE); if (menuDTO instanceof MenuAddForm) { return menu != null; diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java index 755aa892..b44430e4 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java @@ -72,7 +72,7 @@ public class RoleEmployeeService { List departmentIdList = employeeList.stream().filter(e -> e != null && e.getDepartmentId() != null).map(EmployeeVO::getDepartmentId).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(departmentIdList)) { List departmentEntities = departmentDao.selectBatchIds(departmentIdList); - Map departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getName)); + Map departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getDepartmentName)); employeeList.forEach(e -> { e.setDepartmentName(departmentIdNameMap.getOrDefault(e.getDepartmentId(), StringConst.EMPTY)); }); diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml b/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml index 62acf08f..ba1a417f 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml @@ -70,7 +70,7 @@ select t_notice_view_record.*, t_employee.actual_name as employeeName, - t_department.name as departmentName + t_department.department_name from t_notice_view_record left join t_employee on t_employee.employee_id = t_notice_view_record.employee_id left join t_department on t_department.department_id = t_employee.department_id diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml b/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml index 8ee2974d..939008a3 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml @@ -6,7 +6,7 @@ SELECT t_employee.*, - t_department.name AS departmentName + t_department.department_name FROM t_employee LEFT JOIN t_department ON t_department.department_id = t_employee.department_id @@ -169,7 +169,7 @@ SELECT t_employee.*, - t_department.name AS departmentName + t_department.department_name FROM t_employee LEFT JOIN t_department ON t_department.department_id = t_employee.department_id diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java index 5beb7413..2881a4b8 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java @@ -35,7 +35,8 @@ public class CacheConfig { return RedisCacheConfiguration.defaultCacheConfig() .disableCachingNullValues() .computePrefixWith(name -> "cache:" + name + ":") - .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer())); +// .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer())); + ; } @Bean diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/MybatisPlusConfig.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/MybatisPlusConfig.java index 59887aab..24117bce 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/MybatisPlusConfig.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/MybatisPlusConfig.java @@ -7,6 +7,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.transaction.annotation.EnableTransactionManagement; + /** * mp 插件 * diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java index d0bf74b9..3361a8de 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/entity/ChangeLogEntity.java @@ -28,7 +28,7 @@ public class ChangeLogEntity { /** * 版本 */ - private String version; + private String updateVersion; /** * 更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java index 1be8b3f6..239333ce 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogAddForm.java @@ -22,7 +22,7 @@ public class ChangeLogAddForm { @Schema(description = "版本", required = true) @NotBlank(message = "版本 不能为空") - private String version; + private String updateVersion; @SchemaEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误", required = true) diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java index a8489393..13d48ce6 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/form/ChangeLogUpdateForm.java @@ -26,7 +26,7 @@ public class ChangeLogUpdateForm { @Schema(description = "版本", required = true) @NotBlank(message = "版本 不能为空") - private String version; + private String updateVersion; @SchemaEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误", required = true) diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java index e8930d0f..10270f42 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/domain/vo/ChangeLogVO.java @@ -23,7 +23,7 @@ public class ChangeLogVO { private Long changeLogId; @Schema(description = "版本") - private String version; + private String updateVersion; @SchemaEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") private Integer type; diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java index 8823211e..9fd0c846 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/changelog/service/ChangeLogService.java @@ -44,7 +44,7 @@ public class ChangeLogService { * 添加 */ public synchronized ResponseDTO add(ChangeLogAddForm addForm) { - ChangeLogEntity existVersion = changeLogDao.selectByVersion(addForm.getVersion()); + ChangeLogEntity existVersion = changeLogDao.selectByVersion(addForm.getUpdateVersion()); if (existVersion != null) { return ResponseDTO.userErrorParam("此版本已经存在"); } @@ -58,7 +58,7 @@ public class ChangeLogService { * 更新 */ public synchronized ResponseDTO update(ChangeLogUpdateForm updateForm) { - ChangeLogEntity existVersion = changeLogDao.selectByVersion(updateForm.getVersion()); + ChangeLogEntity existVersion = changeLogDao.selectByVersion(updateForm.getUpdateVersion()); if (existVersion != null && !updateForm.getChangeLogId().equals(existVersion.getChangeLogId())) { return ResponseDTO.userErrorParam("此版本已经存在"); } diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java index 1b2fe58c..c0f436dd 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/constant/CodeGeneratorConstant.java @@ -11,16 +11,6 @@ package net.lab1024.sa.base.module.support.codegenerator.constant; */ public class CodeGeneratorConstant { - /** - * 主键 - */ - public final static String PRIMARY_KEY = "PRI"; - - /** - * 自增 - */ - public final static String AUTO_INCREMENT = "auto_increment"; - /** * 默认逻辑删除字段名称 */ diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java index b28c39ec..0fa76e5c 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/domain/vo/TableColumnVO.java @@ -23,20 +23,26 @@ public class TableColumnVO { @Schema(description = "列描述") private String columnComment; - @Schema(description = "columnKey") - private String columnKey; - - @Schema(description = "extra") - private String extra; - - @Schema(description = "是否为空") - private String isNullable; - @Schema(description = "数据类型varchar") private String dataType; - @Schema(description = "列类型varchar(50)") - private String columnType; + @Schema(description = "是否为空") + private Boolean nullableFlag; + @Schema(description = "是否为主键") + private Boolean primaryKeyFlag; + @Schema(description = "是否递增") + private Boolean autoIncreaseFlag; + + // --------------- 临时字段 ------------------- + + @Schema(hidden = true) + private String columnKey; + + @Schema(hidden = true) + private String extra; + + @Schema(hidden = true) + private String isNullable; } diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java index 9aeed115..201f7e7f 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/datatracer/service/DataTracerChangeContentService.java @@ -160,6 +160,16 @@ public class DataTracerChangeContentService { return "【原数据】:
" + oldContent + "
" + "【新数据】:
" + newContent; } + /** + * 解析批量bean的内容 + * + * @param objectList 对象列表 + * @return 单个内容 + */ + public String getChangeContent(List objectList) { + return this.getObjectListContent(objectList); + } + /** * 获取一个对象的内容信息 * diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java index 3b6a2ccf..bf36ccb8 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java @@ -43,7 +43,6 @@ public class HelpDocCatalogEntity { /** * 排序 */ - @TableField("`sort`") private Integer sort; diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java index 6dd02387..b19542c3 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/helpdoc/domain/entity/HelpDocEntity.java @@ -53,7 +53,6 @@ public class HelpDocEntity { /** * 排序 */ - @TableField("`sort`") private Integer sort; /** diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java index ae3840ae..84adc038 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/mail/MailService.java @@ -47,7 +47,7 @@ import java.util.Map; @Component public class MailService { - @Autowired + @Resource private JavaMailSender javaMailSender; @Resource diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java index db573d2a..3282fcf6 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/securityprotect/service/Level3ProtectConfigService.java @@ -3,6 +3,7 @@ package net.lab1024.sa.base.module.support.securityprotect.service; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.module.support.config.ConfigKeyEnum; @@ -29,17 +30,29 @@ public class Level3ProtectConfigService { /** * 开启双因子登录,默认:开启 + * -- GETTER -- + * 开启双因子登录,默认:开启 + */ + @Getter private boolean twoFactorLoginEnabled = false; /** * 连续登录失败次数则锁定,-1表示不受限制,可以一直尝试登录 + * -- GETTER -- + * 连续登录失败次数则锁定,-1表示不受限制,可以一直尝试登录 + */ + @Getter private int loginFailMaxTimes = -1; /** * 连续登录失败锁定时间(单位:秒),-1表示不锁定,建议锁定30分钟 + * -- GETTER -- + * 连续登录失败锁定时间(单位:秒),-1表示不锁定,建议锁定30分钟 + */ + @Getter private int loginFailLockSeconds = 1800; /** @@ -49,61 +62,53 @@ public class Level3ProtectConfigService { /** * 密码复杂度 是否开启,默认:开启 + * -- GETTER -- + * 密码复杂度 是否开启,默认:开启 + */ + @Getter private boolean passwordComplexityEnabled = true; /** * 定期修改密码时间间隔(默认:天),默认:建议90天更换密码 + * -- GETTER -- + * 定期修改密码时间间隔(默认:天),默认:建议90天更换密码 + */ + @Getter private int regularChangePasswordDays = 90; /** * 定期修改密码不允许相同次数,默认:3次以内密码不能相同 + * -- GETTER -- + * 定期修改密码不允许相同次数,默认:3次以内密码不能相同 + */ + @Getter private int regularChangePasswordNotAllowRepeatTimes = 3; /** * 文件大小限制,单位 mb ,(默认:50 mb) + * -- GETTER -- + * 文件大小限制,单位 mb ,(默认:50 mb) + */ + @Getter private long maxUploadFileSizeMb = 50; /** * 文件检测,默认:不开启 + * -- GETTER -- + * 文件检测,默认:不开启 + */ + @Getter private boolean fileDetectFlag = false; @Resource private ConfigService configService; - /** - * 文件检测,默认:不开启 - */ - public boolean isFileDetectFlag() { - return fileDetectFlag; - } - - /** - * 文件大小限制,单位 mb ,(默认:50 mb) - */ - public long getMaxUploadFileSizeMb() { - return maxUploadFileSizeMb; - } - - /** - * 连续登录失败次数则锁定,-1表示不受限制,可以一直尝试登录 - */ - public int getLoginFailMaxTimes() { - return loginFailMaxTimes; - } - - /** - * 连续登录失败锁定时间(单位:秒),-1表示不锁定,建议锁定30分钟 - */ - public int getLoginFailLockSeconds() { - return loginFailLockSeconds; - } - /** * 最低活跃时间(单位:秒),超过此时间没有操作系统就会被冻结,默认-1 代表不限制,永不冻结; 默认 30分钟 */ @@ -111,34 +116,6 @@ public class Level3ProtectConfigService { return loginActiveTimeoutSeconds > 0 ? loginActiveTimeoutSeconds : -1; } - /** - * 定期修改密码时间间隔(默认:天),默认:建议90天更换密码 - */ - public int getRegularChangePasswordDays() { - return regularChangePasswordDays; - } - - /** - * 开启双因子登录,默认:开启 - */ - public boolean isTwoFactorLoginEnabled() { - return twoFactorLoginEnabled; - } - - /** - * 密码复杂度 是否开启,默认:开启 - */ - public boolean isPasswordComplexityEnabled() { - return passwordComplexityEnabled; - } - - /** - * 定期修改密码不允许相同次数,默认:3次以内密码不能相同 - */ - public int getRegularChangePasswordNotAllowRepeatTimes() { - return regularChangePasswordNotAllowRepeatTimes; - } - @PostConstruct void init() { String configValue = configService.getConfigValue(ConfigKeyEnum.LEVEL3_PROTECT_CONFIG); diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java index 4f76dfad..95f7ed32 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/SerialNumberBaseService.java @@ -9,6 +9,8 @@ import net.lab1024.sa.base.module.support.serialnumber.dao.SerialNumberDao; import net.lab1024.sa.base.module.support.serialnumber.dao.SerialNumberRecordDao; import net.lab1024.sa.base.module.support.serialnumber.domain.*; import org.apache.commons.lang3.RandomUtils; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -92,6 +94,7 @@ public abstract class SerialNumberBaseService implements SerialNumberService { public abstract void initLastGenerateData(List serialNumberEntityList); @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) public String generate(SerialNumberIdEnum serialNumberIdEnum) { List generateList = this.generate(serialNumberIdEnum, 1); if (generateList == null || generateList.isEmpty()) { @@ -101,6 +104,7 @@ public abstract class SerialNumberBaseService implements SerialNumberService { } @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) public List generate(SerialNumberIdEnum serialNumberIdEnum, int count) { SerialNumberInfoBO serialNumberInfoBO = serialNumberMap.get(serialNumberIdEnum.getSerialNumberId()); if (serialNumberInfoBO == null) { diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java index d83d9368..6bf65f77 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/serialnumber/service/impl/SerialNumberRedisService.java @@ -9,7 +9,6 @@ import net.lab1024.sa.base.module.support.serialnumber.domain.SerialNumberGenera import net.lab1024.sa.base.module.support.serialnumber.domain.SerialNumberInfoBO; import net.lab1024.sa.base.module.support.serialnumber.domain.SerialNumberLastGenerateBO; import net.lab1024.sa.base.module.support.serialnumber.service.SerialNumberBaseService; -import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @@ -61,22 +60,24 @@ public class SerialNumberRedisService extends SerialNumberBaseService { public List generateSerialNumberList(SerialNumberInfoBO serialNumberInfo, int count) { SerialNumberGenerateResultBO serialNumberGenerateResult = null; String lockKey = RedisKeyConst.Support.SERIAL_NUMBER + serialNumberInfo.getSerialNumberId(); - try { - boolean lock = false; - for (int i = 0; i < MAX_GET_LOCK_COUNT; i++) { - try { - lock = redisService.getLock(lockKey, 60 * 1000L); - if (lock) { - break; - } - Thread.sleep(SLEEP_MILLISECONDS); - } catch (Throwable e) { - log.error(e.getMessage(), e); + + boolean lock = false; + for (int i = 0; i < MAX_GET_LOCK_COUNT; i++) { + try { + lock = redisService.getLock(lockKey, 60 * 1000L); + if (lock) { + break; } + Thread.sleep(SLEEP_MILLISECONDS); + } catch (Throwable e) { + log.error(e.getMessage(), e); } - if (!lock) { - throw new BusinessException("SerialNumber 尝试5次,未能生成单号"); - } + } + if (!lock) { + throw new BusinessException("SerialNumber 尝试5次,未能生成单号"); + } + + try { // 获取上次的生成结果 SerialNumberLastGenerateBO lastGenerateBO = (SerialNumberLastGenerateBO) redisService.mget( RedisKeyConst.Support.SERIAL_NUMBER_LAST_INFO, diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml index 09136785..126951f4 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/ChangeLogMapper.xml @@ -14,7 +14,7 @@
- AND ( INSTR(t_change_log.version,#{queryForm.keyword}) + AND ( INSTR(t_change_log.update_version,#{queryForm.keyword}) OR INSTR(t_change_log.publish_author,#{queryForm.keyword}) OR INSTR(t_change_log.content,#{queryForm.keyword}) ) @@ -35,12 +35,12 @@ AND t_change_log.link = #{queryForm.link} - order by t_change_log.version desc + order by t_change_log.update_version desc diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml index b2b88edc..cffb1b66 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/LoginLogMapper.xml @@ -13,7 +13,7 @@ AND user_type = #{query.userType} - + AND INSTR(login_ip,#{query.ip}) @@ -25,9 +25,6 @@ AND INSTR(user_name,#{query.userName}) - - AND INSTR(login_ip,#{query.ip}) - order by create_time desc @@ -37,9 +34,9 @@ * from t_login_log where - user_id = #{userId} - and user_type = #{userType} - and login_result = #{loginLogResult} + user_id = #{userId} + and user_type = #{userType} + and login_result = #{loginLogResult} order by login_log_id desc limit 1 diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml index fcf1d8e1..d00adff0 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml @@ -23,10 +23,10 @@ AND INSTR(operate_user_name,#{query.userName}) - AND (INSTR(`module`,#{query.keywords}) OR INSTR(content,#{query.keywords})) + AND (INSTR(module,#{query.keywords}) OR INSTR(content,#{query.keywords})) - AND (INSTR(`url`,#{query.requestKeywords}) OR INSTR(`method`,#{query.requestKeywords}) OR INSTR(`param`,#{query.requestKeywords})) + AND (INSTR(url,#{query.requestKeywords}) OR INSTR(method,#{query.requestKeywords}) OR INSTR(param,#{query.requestKeywords})) AND success_flag = #{query.successFlag} diff --git a/smart-admin-web-javascript/README.en.md b/smart-admin-web-javascript/README.en.md new file mode 100644 index 00000000..e69de29b diff --git a/smart-admin-web-javascript/README.md b/smart-admin-web-javascript/README.md new file mode 100644 index 00000000..e69de29b diff --git a/smart-admin-web-javascript/src/components/system/department-tree-select/index.vue b/smart-admin-web-javascript/src/components/system/department-tree-select/index.vue index e9de7998..053ab23f 100644 --- a/smart-admin-web-javascript/src/components/system/department-tree-select/index.vue +++ b/smart-admin-web-javascript/src/components/system/department-tree-select/index.vue @@ -12,7 +12,7 @@ - - + + @@ -85,7 +85,7 @@ const formDefault = { changeLogId: undefined, - version: undefined, //版本 + updateVersion: undefined, //版本 type: undefined, //更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] publishAuthor: undefined, //发布人 publicDate: undefined, //发布日期 @@ -96,7 +96,7 @@ let form = reactive({ ...formDefault }); const rules = { - version: [{ required: true, message: '版本 必填' }], + updateVersion: [{ required: true, message: '版本 必填' }], type: [{ required: true, message: '更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 必填' }], publishAuthor: [{ required: true, message: '发布人 必填' }], publicDate: [{ required: true, message: '发布日期 必填' }], diff --git a/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue b/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue index b2e38308..0c5c8e61 100644 --- a/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue +++ b/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue @@ -75,7 +75,7 @@ :row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }" >