mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-08 05:06:39 +08:00
后端system包和表结构全部完成
This commit is contained in:
parent
4734d3c408
commit
30af9210f1
@ -22,6 +22,6 @@ public class SmartAdminApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SmartAdminApplication.class, args);
|
||||
System.out.println("####################### smart-admin-service start #######################");
|
||||
System.out.println("####################### smart-admin-2.0-service start #######################");
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package net.lab1024.smartadmin.service.filter;
|
||||
|
||||
import net.lab1024.smartadmin.service.common.constant.RequestHeaderConst;
|
||||
import net.lab1024.smartadmin.service.module.system.login.domain.LoginUserDetail;
|
||||
import net.lab1024.smartadmin.service.module.system.login.service.JwtService;
|
||||
import net.lab1024.smartadmin.service.module.system.login.domain.EmployeeLoginBO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
@ -45,9 +45,9 @@ public class SecurityTokenFilter extends OncePerRequestFilter {
|
||||
}
|
||||
//清理spring security
|
||||
SecurityContextHolder.clearContext();
|
||||
EmployeeLoginBO loginBO = loginTokenService.getEmployeeLoginBO(xAccessToken);
|
||||
if (null != loginBO) {
|
||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginBO, null, loginBO.getAuthorities());
|
||||
LoginUserDetail loginUserDetail = loginTokenService.getEmployeeLoginBO(xAccessToken);
|
||||
if (null != loginUserDetail) {
|
||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUserDetail, null, loginUserDetail.getAuthorities());
|
||||
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
|
||||
SecurityContextHolder.getContext().setAuthentication(authenticationToken);
|
||||
}
|
||||
|
@ -19,11 +19,11 @@ public class SmartAdminStartupRunner implements CommandLineRunner {
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
|
||||
log.info("###################### SmartAdmin v2.x init start ######################");
|
||||
log.info("###################### SmartAdmin v2 init start ######################");
|
||||
|
||||
// 初始化状态码
|
||||
ErrorCodeRegister.init();
|
||||
|
||||
log.info("###################### SmartAdmin v2.x init complete ######################");
|
||||
log.info("###################### SmartAdmin v2 init complete ######################");
|
||||
}
|
||||
}
|
@ -7,8 +7,8 @@ import net.lab1024.smartadmin.service.common.domain.PageResult;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.common.swagger.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.module.business.goods.domain.*;
|
||||
import net.lab1024.smartadmin.service.module.system.login.domain.EmployeeLoginInfoDTO;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartRequestUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.login.domain.RequestEmployee;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -32,7 +32,7 @@ public class GoodsController extends SystemBaseController {
|
||||
@ApiOperation("添加商品 by listen")
|
||||
@PostMapping("/goods/add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid GoodsAddForm addForm) {
|
||||
EmployeeLoginInfoDTO employee = SmartRequestUtil.getRequestEmployee();
|
||||
RequestEmployee employee = SmartRequestUtil.getRequestEmployee();
|
||||
addForm.setUpdateId(employee.getEmployeeId());
|
||||
addForm.setUpdateName(employee.getActualName());
|
||||
return goodsService.add(addForm);
|
||||
@ -41,7 +41,7 @@ public class GoodsController extends SystemBaseController {
|
||||
@ApiOperation("更新商品 by listen")
|
||||
@PostMapping("/goods/update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid GoodsUpdateForm updateForm) {
|
||||
EmployeeLoginInfoDTO employee = SmartRequestUtil.getRequestEmployee();
|
||||
RequestEmployee employee = SmartRequestUtil.getRequestEmployee();
|
||||
updateForm.setUpdateId(employee.getEmployeeId());
|
||||
updateForm.setUpdateName(employee.getActualName());
|
||||
return goodsService.update(updateForm);
|
||||
@ -50,7 +50,7 @@ public class GoodsController extends SystemBaseController {
|
||||
@ApiOperation("删除 by listen")
|
||||
@PostMapping("/goods/del")
|
||||
public ResponseDTO<String> del(@RequestBody @Valid GoodsDelForm delForm) {
|
||||
EmployeeLoginInfoDTO employee = SmartRequestUtil.getRequestEmployee();
|
||||
RequestEmployee employee = SmartRequestUtil.getRequestEmployee();
|
||||
delForm.setUpdateId(employee.getEmployeeId());
|
||||
delForm.setUpdateName(employee.getActualName());
|
||||
return goodsService.del(delForm);
|
||||
|
@ -8,7 +8,7 @@ import net.lab1024.smartadmin.service.common.constant.StringConst;
|
||||
import net.lab1024.smartadmin.service.constant.RedisKeyConst;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.module.support.captcha.domain.CaptchaVO;
|
||||
import net.lab1024.smartadmin.service.third.SmartRedisService;
|
||||
import net.lab1024.smartadmin.service.module.support.redis.RedisService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -34,7 +34,7 @@ public class CaptchaService {
|
||||
private DefaultKaptcha defaultKaptcha;
|
||||
|
||||
@Autowired
|
||||
private SmartRedisService redisService;
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 获取生成图形验证码
|
||||
@ -88,7 +88,7 @@ public class CaptchaService {
|
||||
return ResponseDTO.error(UserErrorCode.PARAM_ERROR, "验证码错误或已过期,请刷新重试" );
|
||||
}
|
||||
// 校验通过 移除
|
||||
redisService.del(redisKey);
|
||||
redisService.delete(redisKey);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ public enum DataScopeViewTypeEnum implements BaseEnum {
|
||||
|
||||
DEPARTMENT_AND_SUB(2, 10, "本部门及下属子部门"),
|
||||
|
||||
SCHOOL(3, 15, "本校区"),
|
||||
|
||||
ALL(10, 100, "全部");
|
||||
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
package net.lab1024.smartadmin.service.module.support.datascope.service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBaseEnumUtil;
|
||||
import net.lab1024.smartadmin.service.module.support.datascope.constant.DataScopeTypeEnum;
|
||||
import net.lab1024.smartadmin.service.module.support.datascope.constant.DataScopeViewTypeEnum;
|
||||
import net.lab1024.smartadmin.service.module.support.datascope.domain.entity.DataScopeRoleEntity;
|
||||
@ -13,7 +11,9 @@ import net.lab1024.smartadmin.service.module.system.employee.domain.entity.Emplo
|
||||
import net.lab1024.smartadmin.service.module.system.menu.service.MenuEmployeeService;
|
||||
import net.lab1024.smartadmin.service.module.system.role.dao.RoleDataScopeDao;
|
||||
import net.lab1024.smartadmin.service.module.system.role.dao.RoleEmployeeDao;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBaseEnumUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@ -66,9 +66,6 @@ public class DataScopeViewService {
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
|
||||
return this.getDepartmentAndSubEmployeeIdList(employeeId);
|
||||
}
|
||||
if (DataScopeViewTypeEnum.SCHOOL == viewType) {
|
||||
return this.getSchoolEmployeeIdList(employeeId);
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@ -90,9 +87,6 @@ public class DataScopeViewService {
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
|
||||
return this.getDepartmentAndSubIdList(employeeId);
|
||||
}
|
||||
if (DataScopeViewTypeEnum.SCHOOL == viewType) {
|
||||
return this.getSchoolDepartmentIdList(employeeId);
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@ -158,7 +152,7 @@ public class DataScopeViewService {
|
||||
*/
|
||||
private List<Long> getDepartmentEmployeeIdList(Long employeeId) {
|
||||
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
|
||||
List<Long> employeeIdList = employeeDao.getEmployeeIdByDepartmentId(employeeEntity.getDepartmentId(), null, null, false);
|
||||
List<Long> employeeIdList = employeeDao.getEmployeeIdByDepartmentId(employeeEntity.getDepartmentId(), false);
|
||||
return employeeIdList;
|
||||
}
|
||||
|
||||
@ -170,39 +164,7 @@ public class DataScopeViewService {
|
||||
*/
|
||||
private List<Long> getDepartmentAndSubEmployeeIdList(Long employeeId) {
|
||||
List<Long> allDepartmentIds = getDepartmentAndSubIdList(employeeId);
|
||||
List<Long> employeeIdList = employeeDao.getEmployeeIdByDepartmentIdList(allDepartmentIds, null, null, false);
|
||||
List<Long> employeeIdList = employeeDao.getEmployeeIdByDepartmentIdList(allDepartmentIds, false);
|
||||
return employeeIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认所属分校的所有员工id
|
||||
*
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
private List<Long> getSchoolEmployeeIdList(Long employeeId) {
|
||||
Long schoolDepartmentId = departmentService.getSchoolIdByEmployeeId(employeeId);
|
||||
if (schoolDepartmentId == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<Long> allDepartmentIds = departmentService.selfAndChildrenIdList(schoolDepartmentId);
|
||||
List<Long> employeeIdList = employeeDao.getEmployeeIdByDepartmentIdList(allDepartmentIds, null, null, false);
|
||||
return employeeIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认所属分校的所有部门id
|
||||
*
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
private List<Long> getSchoolDepartmentIdList(Long employeeId) {
|
||||
Long schoolDepartmentId = departmentService.getSchoolIdByEmployeeId(employeeId);
|
||||
if (schoolDepartmentId == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<Long> allDepartmentIds = departmentService.selfAndChildrenIdList(schoolDepartmentId);
|
||||
return allDepartmentIds;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,13 +11,14 @@ import net.lab1024.smartadmin.service.module.support.datatracer.anno.FieldDoc;
|
||||
import net.lab1024.smartadmin.service.module.support.datatracer.anno.FieldEnumValue;
|
||||
import net.lab1024.smartadmin.service.module.support.datatracer.anno.FieldSqlValue;
|
||||
import net.lab1024.smartadmin.service.module.support.datatracer.constant.DataTracerOperateTypeEnum;
|
||||
import net.lab1024.smartadmin.service.third.SmartApplicationContext;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBaseEnumUtil;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBigDecimalUtil;
|
||||
import net.lab1024.smartadmin.service.common.util.date.SmartDateFormatterEnum;
|
||||
import net.lab1024.smartadmin.service.common.util.date.SmartLocalDateUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
@ -39,6 +40,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
@Service
|
||||
public class DataTracerFieldService {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
/**
|
||||
* 字段描述缓存
|
||||
*/
|
||||
@ -299,7 +303,7 @@ public class DataTracerFieldService {
|
||||
*/
|
||||
private String getRelateDisplayValue(Object fieldValue, FieldSqlValue fieldSqlValue) {
|
||||
Class<? extends BaseMapper> relateMapper = fieldSqlValue.relateMapper();
|
||||
BaseMapper mapper = SmartApplicationContext.getBean(relateMapper);
|
||||
BaseMapper mapper = applicationContext.getBean(relateMapper);
|
||||
if (mapper == null) {
|
||||
return "";
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import net.lab1024.smartadmin.service.module.support.file.domain.dto.FileQuery;
|
||||
import net.lab1024.smartadmin.service.module.support.file.domain.dto.FileUrlUploadForm;
|
||||
import net.lab1024.smartadmin.service.module.support.file.domain.vo.FileUploadVO;
|
||||
import net.lab1024.smartadmin.service.module.support.file.domain.vo.FileVO;
|
||||
import net.lab1024.smartadmin.service.third.SmartRedisService;
|
||||
import net.lab1024.smartadmin.service.module.support.redis.RedisService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -62,7 +62,7 @@ public class FileService {
|
||||
private FileDao fileDao;
|
||||
|
||||
@Autowired
|
||||
private SmartRedisService redisService;
|
||||
private RedisService redisService;
|
||||
|
||||
@Value("${spring.servlet.multipart.max-file-size}")
|
||||
private String maxFileSize;
|
||||
|
@ -6,7 +6,6 @@ import net.lab1024.smartadmin.service.module.support.operatelog.OperateLogDao;
|
||||
import net.lab1024.smartadmin.service.module.support.operatelog.domain.dto.OperateLogConfigDTO;
|
||||
import net.lab1024.smartadmin.service.module.support.operatelog.domain.dto.OperateLogUserDTO;
|
||||
import net.lab1024.smartadmin.service.module.support.operatelog.domain.OperateLogEntity;
|
||||
import net.lab1024.smartadmin.service.third.SmartApplicationContext;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartStringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -18,6 +17,8 @@ import org.aspectj.lang.annotation.AfterThrowing;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
@ -40,6 +41,9 @@ public class OperateLogAspect {
|
||||
|
||||
private static final String pointCut = "@within(org.springframework.web.bind.annotation.RestController) || @within(org.springframework.stereotype.Controller)";
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
private OperateLogConfigDTO smartLogConfig;
|
||||
|
||||
/**
|
||||
@ -256,12 +260,13 @@ public class OperateLogAspect {
|
||||
|
||||
/**
|
||||
* 保存操作日志
|
||||
*
|
||||
* @param operateLogEntity
|
||||
* @return
|
||||
*/
|
||||
private Boolean saveLog(OperateLogEntity operateLogEntity) {
|
||||
if (smartLogConfig.getSaveFunction() == null) {
|
||||
BaseMapper mapper = SmartApplicationContext.getBean(OperateLogDao.class);
|
||||
BaseMapper mapper = applicationContext.getBean(OperateLogDao.class);
|
||||
if (mapper == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.lab1024.smartadmin.service.third;
|
||||
package net.lab1024.smartadmin.service.module.support.redis;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -26,9 +26,9 @@ import java.util.concurrent.TimeUnit;
|
||||
* @date 2020/8/25 11:57
|
||||
*/
|
||||
@Component
|
||||
public class SmartRedisService {
|
||||
public class RedisService {
|
||||
|
||||
private static final Logger log = org.slf4j.LoggerFactory.getLogger(SmartRedisService.class);
|
||||
private static final Logger log = org.slf4j.LoggerFactory.getLogger(RedisService.class);
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
@ -117,7 +117,7 @@ public class SmartRedisService {
|
||||
* @param key 可以传一个值 或多个
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void del(String... key) {
|
||||
public void delete(String... key) {
|
||||
if (key != null && key.length > 0) {
|
||||
if (key.length == 1) {
|
||||
redisTemplate.delete(key[0]);
|
||||
@ -132,7 +132,7 @@ public class SmartRedisService {
|
||||
*
|
||||
* @param keyList
|
||||
*/
|
||||
public void del(List<String> keyList) {
|
||||
public void delete(List<String> keyList) {
|
||||
if (CollectionUtils.isEmpty(keyList)) {
|
||||
return;
|
||||
}
|
@ -2,10 +2,13 @@ package net.lab1024.smartadmin.service.module.system.department.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.lab1024.smartadmin.service.module.system.department.domain.entity.DepartmentEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.department.domain.vo.DepartmentVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* t_department dao接口
|
||||
*
|
||||
@ -28,5 +31,6 @@ public interface DepartmentDao extends BaseMapper<DepartmentEntity> {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DepartmentVO> listAll();
|
||||
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class DepartmentService {
|
||||
}
|
||||
|
||||
// 是否有未删除员工
|
||||
int employeeNum = employeeDao.countByDepartmentId(departmentId, false);
|
||||
int employeeNum = employeeDao.countByDepartmentId(departmentId);
|
||||
if (employeeNum > 0) {
|
||||
return ResponseDTO.error(UserErrorCode.PARAM_ERROR, "请先删除部门员工");
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class EmployeeCacheService {
|
||||
*/
|
||||
@Cacheable(CacheModuleConst.Employee.DEPARTMENT_EMPLOYEE_CACHE)
|
||||
public List<EmployeeEntity> departmentEmployeeCache(Long departmentId) {
|
||||
List<EmployeeEntity> employeeEntityList = employeeDao.selectByDepartmentId(departmentId, null, null, false);
|
||||
List<EmployeeEntity> employeeEntityList = employeeDao.selectByDepartmentId(departmentId, false);
|
||||
return employeeEntityList;
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public class EmployeeCacheService {
|
||||
if (null == employeeEntity) {
|
||||
return null;
|
||||
}
|
||||
if (employeeEntity.getDeletedFlag()) {
|
||||
if (employeeEntity.getDisabledFlag()) {
|
||||
return null;
|
||||
}
|
||||
return employeeEntity;
|
||||
|
@ -56,12 +56,6 @@ public class EmployeeController extends SystemBaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "批量删除员工 @author zhuoda")
|
||||
@GetMapping("/employee/update/batch/delete")
|
||||
public ResponseDTO<String> batchUpdateDeleteFlag(@RequestParam("employeeIdList") List<Long> employeeIdList) {
|
||||
return employeeService.batchUpdateDeleteFlag(employeeIdList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量调整员工部门 @author zhuoda")
|
||||
@PostMapping("/employee/update/batch/department")
|
||||
public ResponseDTO<String> batchUpdateDepartment(@Valid @RequestBody EmployeeBatchUpdateDepartmentForm batchUpdateDepartmentForm) {
|
||||
|
@ -247,39 +247,6 @@ public class EmployeeService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除员工
|
||||
*
|
||||
* @param employeeIdList 员工ID列表
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> batchUpdateDeleteFlag(List<Long> employeeIdList) {
|
||||
if (CollectionUtils.isEmpty(employeeIdList)) {
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
List<EmployeeEntity> employeeEntityList = employeeManager.listByIds(employeeIdList);
|
||||
if (CollectionUtils.isEmpty(employeeEntityList)) {
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
// 更新删除
|
||||
List<EmployeeEntity> deleteList = employeeIdList.stream().map(e -> {
|
||||
EmployeeEntity updateEmployee = new EmployeeEntity();
|
||||
updateEmployee.setId(e);
|
||||
updateEmployee.setDeletedFlag(true);
|
||||
return updateEmployee;
|
||||
}).collect(Collectors.toList());
|
||||
employeeManager.updateBatchById(deleteList);
|
||||
|
||||
// 清除缓存
|
||||
employeeEntityList.forEach(e -> {
|
||||
employeeCacheService.clearCacheByEmployeeId(e.getId());
|
||||
employeeCacheService.clearCacheByDepartmentId(e.getDepartmentId());
|
||||
});
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新部门
|
||||
*
|
||||
@ -351,10 +318,10 @@ public class EmployeeService {
|
||||
* @param departmentId
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(Long departmentId, Boolean leaveFlag) {
|
||||
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(Long departmentId, Boolean disabledFlag) {
|
||||
List<EmployeeEntity> employeeEntityList = employeeCacheService.departmentEmployeeCache(departmentId);
|
||||
if (leaveFlag != null) {
|
||||
employeeEntityList = employeeEntityList.stream().filter(e -> e.getLeaveFlag().equals(leaveFlag)).collect(Collectors.toList());
|
||||
if (disabledFlag != null) {
|
||||
employeeEntityList = employeeEntityList.stream().filter(e -> e.getDisabledFlag().equals(disabledFlag)).collect(Collectors.toList());
|
||||
}
|
||||
// 获取部门
|
||||
List<DepartmentVO> departmentList = departmentCacheService.departmentCache();
|
||||
|
@ -37,8 +37,6 @@ public class EmployeeEntity {
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*
|
||||
* @see net.lab1024.smartadmin.service.common.constant.GenderEnum
|
||||
*/
|
||||
private Integer gender;
|
||||
|
||||
@ -57,16 +55,6 @@ public class EmployeeEntity {
|
||||
*/
|
||||
private Boolean disabledFlag;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deletedFlag;
|
||||
|
||||
/**
|
||||
* 是否离职
|
||||
*/
|
||||
private Boolean leaveFlag;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ -76,9 +64,5 @@ public class EmployeeEntity {
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 是否校盈易导入数据
|
||||
*/
|
||||
private Boolean importFlag;
|
||||
|
||||
}
|
||||
|
@ -43,10 +43,6 @@ public class EmployeeAddForm {
|
||||
@NotNull(message = "是否被禁用不能为空")
|
||||
private Boolean disabledFlag;
|
||||
|
||||
@ApiModelProperty("是否离职")
|
||||
@NotNull(message = "是否离职不能为空")
|
||||
private Boolean leaveFlag;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@NotNull(message = "手机号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
|
||||
|
@ -2,8 +2,9 @@ package net.lab1024.smartadmin.service.module.system.employee.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import net.lab1024.smartadmin.service.common.annoation.ApiModelPropertyEnum;
|
||||
import net.lab1024.smartadmin.service.common.constant.GenderEnum;
|
||||
import net.lab1024.smartadmin.service.common.enumeration.GenderEnum;
|
||||
import net.lab1024.smartadmin.service.common.swagger.ApiModelPropertyEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -38,9 +39,6 @@ public class EmployeeVO {
|
||||
@ApiModelProperty("是否被禁用")
|
||||
private Boolean disabledFlag;
|
||||
|
||||
@ApiModelProperty("是否离职")
|
||||
private Boolean leaveFlag;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String departmentName;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import net.lab1024.smartadmin.service.module.system.menu.domain.bo.MenuLoginBO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.service.MenuEmployeeService;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.SystemConfigKeyEnum;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.SystemConfigService;
|
||||
import net.lab1024.smartadmin.service.third.SmartRedisService;
|
||||
import net.lab1024.smartadmin.service.module.support.redis.RedisService;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -57,7 +57,7 @@ public class LoginService {
|
||||
private DefaultKaptcha defaultKaptcha;
|
||||
|
||||
@Autowired
|
||||
private SmartRedisService redisService;
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private MenuEmployeeService menuEmployeeService;
|
||||
@ -84,7 +84,7 @@ public class LoginService {
|
||||
return ResponseDTO.error(UserErrorCode.PARAM_ERROR, "验证码错误");
|
||||
}
|
||||
// 删除已使用的验证码
|
||||
redisService.del(redisCaptchaKey);
|
||||
redisService.delete(redisCaptchaKey);
|
||||
|
||||
/**
|
||||
* 验证账号和账号状态
|
||||
|
@ -2,10 +2,11 @@ package net.lab1024.smartadmin.service.module.system.menu.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.smartadmin.service.common.controller.SystemBaseController;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartRequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.common.controller.AdminBaseController;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.form.MenuAddForm;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.form.MenuUpdateForm;
|
||||
@ -13,7 +14,6 @@ import net.lab1024.smartadmin.service.module.system.menu.domain.vo.MenuTreeVO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.MenuVO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.RequestUrlVO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.service.MenuService;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartRequestEmployeeUtil;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -25,7 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
@Api(tags = {SwaggerTagConst.System.MANAGER_MENU})
|
||||
@RestController
|
||||
public class MenuController extends AdminBaseController {
|
||||
public class MenuController extends SystemBaseController {
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
@ -33,21 +33,21 @@ public class MenuController extends AdminBaseController {
|
||||
@ApiOperation(value = "添加菜单 @author zhuoda")
|
||||
@PostMapping("/menu/add")
|
||||
public ResponseDTO<String> addMenu(@RequestBody @Valid MenuAddForm menuAddForm) {
|
||||
menuAddForm.setCreateUserId(SmartRequestEmployeeUtil.getRequestEmployeeId());
|
||||
menuAddForm.setCreateUserId(SmartRequestUtil.getRequestEmployeeId());
|
||||
return menuService.addMenu(menuAddForm);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新菜单 @author zhuoda")
|
||||
@PostMapping("/menu/update")
|
||||
public ResponseDTO<String> updateMenu(@RequestBody @Valid MenuUpdateForm menuUpdateForm) {
|
||||
menuUpdateForm.setUpdateUserId(SmartRequestEmployeeUtil.getRequestEmployeeId());
|
||||
menuUpdateForm.setUpdateUserId(SmartRequestUtil.getRequestEmployeeId());
|
||||
return menuService.updateMenu(menuUpdateForm);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除菜单 @author zhuoda")
|
||||
@GetMapping("/menu/batchDelete")
|
||||
public ResponseDTO<String> batchDeleteMenu(@RequestParam("menuIdList") List<Long> menuIdList) {
|
||||
return menuService.batchDeleteMenu(menuIdList, SmartRequestEmployeeUtil.getRequestEmployeeId());
|
||||
return menuService.batchDeleteMenu(menuIdList, SmartRequestUtil.getRequestEmployeeId());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询菜单列表 @author zhuoda")
|
||||
|
@ -1,11 +1,7 @@
|
||||
package net.lab1024.smartadmin.service.module.system.menu.service;
|
||||
|
||||
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartStringUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.employee.EmployeeService;
|
||||
import net.lab1024.smartadmin.service.module.system.login.domain.RequestEmployee;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.constant.MenuTypeEnum;
|
||||
@ -14,9 +10,13 @@ import net.lab1024.smartadmin.service.module.system.menu.domain.vo.MenuTreeVO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.MenuVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.dao.RoleMenuDao;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.entity.RoleMenuEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.SystemConfigEnum;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.SystemConfigKeyEnum;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.SystemConfigService;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartStringUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Comparator;
|
||||
@ -104,7 +104,7 @@ public class MenuEmployeeService {
|
||||
* @return
|
||||
*/
|
||||
public Boolean isSuperman(Long employeeId) {
|
||||
String systemConfigValue = systemConfigService.getConfigValue(SystemConfigEnum.Key.EMPLOYEE_SUPERMAN);
|
||||
String systemConfigValue = systemConfigService.getConfigValue(SystemConfigKeyEnum.EMPLOYEE_SUPERMAN);
|
||||
List<Long> superManIdsList = SmartStringUtil.splitConverToLongList(systemConfigValue, ",");
|
||||
return superManIdsList.contains(employeeId);
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
package net.lab1024.smartadmin.service.module.system.menu.service;
|
||||
|
||||
import net.lab1024.smartadmin.service.common.security.SecurityMetadataSource;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartRequestUtil;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import net.lab1024.smartadmin.service.common.security.SmartSecurityMetadataSource;
|
||||
import net.lab1024.smartadmin.service.module.system.login.domain.RequestEmployee;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartRequestEmployeeUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@ -18,7 +18,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* @author lihaifan
|
||||
* @date 2021/8/5 17:14
|
||||
*/
|
||||
@Service(SmartSecurityMetadataSource.PRIVILEGE_CHECK_NAME)
|
||||
@Service(SecurityMetadataSource.PRIVILEGE_CHECK_NAME)
|
||||
public class MenuPermissionService {
|
||||
|
||||
@Autowired
|
||||
@ -40,7 +40,7 @@ public class MenuPermissionService {
|
||||
if(StringUtils.isNotBlank(checkPermission) && BooleanUtils.toBoolean(checkPermission)){
|
||||
return true;
|
||||
}
|
||||
RequestEmployee requestEmployee = SmartRequestEmployeeUtil.getRequestEmployee();
|
||||
RequestEmployee requestEmployee = SmartRequestUtil.getRequestEmployee();
|
||||
if(requestEmployee == null){
|
||||
return false;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import net.lab1024.smartadmin.service.common.code.SystemErrorCode;
|
||||
import net.lab1024.smartadmin.service.common.code.UserErrorCode;
|
||||
import net.lab1024.smartadmin.service.common.constant.CommonConst;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.dao.MenuDao;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.constant.MenuTypeEnum;
|
||||
@ -33,6 +32,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class MenuService {
|
||||
|
||||
private static final long DEFAULT_PARENT_ID = 0;
|
||||
|
||||
@Autowired
|
||||
private MenuDao menuDao;
|
||||
|
||||
@ -174,7 +175,7 @@ public class MenuService {
|
||||
List<MenuVO> menuVOList = menuDao.queryMenuList(Boolean.FALSE, disabledFlag, null);
|
||||
//根据ParentId进行分组
|
||||
Map<Long, List<MenuVO>> parentMap = menuVOList.stream().collect(Collectors.groupingBy(MenuVO::getParentId, Collectors.toList()));
|
||||
List<MenuVO> filterMenuVOList = this.filterNoParentMenu(parentMap, CommonConst.DEFAULT_PARENT_ID);
|
||||
List<MenuVO> filterMenuVOList = this.filterNoParentMenu(parentMap, DEFAULT_PARENT_ID);
|
||||
return filterMenuVOList;
|
||||
}
|
||||
|
||||
@ -218,7 +219,7 @@ public class MenuService {
|
||||
List<MenuVO> menuVOList = menuDao.queryMenuList(Boolean.FALSE, null, menuTypeList);
|
||||
//根据ParentId进行分组
|
||||
Map<Long, List<MenuVO>> parentMap = menuVOList.stream().collect(Collectors.groupingBy(MenuVO::getParentId, Collectors.toList()));
|
||||
List<MenuTreeVO> menuTreeVOList = this.buildMenuTree(parentMap, CommonConst.DEFAULT_PARENT_ID);
|
||||
List<MenuTreeVO> menuTreeVOList = this.buildMenuTree(parentMap, DEFAULT_PARENT_ID);
|
||||
return ResponseDTO.ok(menuTreeVOList);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
package net.lab1024.smartadmin.service.module.system.menu.service;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartStringUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.RequestUrlVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
@ -14,9 +16,6 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
import net.lab1024.smartadmin.service.common.constant.CommonConst;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.RequestUrlVO;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartStringUtil;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
@ -33,6 +32,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@Service
|
||||
public class RequestUrlService {
|
||||
|
||||
private static final Set<String> IGNORE_URL = ImmutableSet.of("/swagger", "Excel");
|
||||
|
||||
/**
|
||||
* 系统所有requestUrl
|
||||
*/
|
||||
@ -80,8 +81,7 @@ public class RequestUrlService {
|
||||
methodComment = handlerMethod.getMethod().getName();
|
||||
}
|
||||
}
|
||||
Set<String> urlSet = this.getUrlSet(patterns);
|
||||
for (String url : urlSet) {
|
||||
for (String url : patterns) {
|
||||
RequestUrlVO requestUrlVO = new RequestUrlVO();
|
||||
requestUrlVO.setUrl(url);
|
||||
requestUrlVO.setName(name);
|
||||
@ -92,20 +92,6 @@ public class RequestUrlService {
|
||||
});
|
||||
}
|
||||
|
||||
private Set<String> getUrlSet(Set<String> patterns) {
|
||||
Set<String> urlSet = Sets.newHashSet();
|
||||
for (String url : patterns) {
|
||||
for (String ignoreUrl : CommonConst.CommonCollection.IGNORE_URL_MAPPING) {
|
||||
if (url.startsWith(ignoreUrl)) {
|
||||
urlSet.add(url.substring(ignoreUrl.length() - 1));
|
||||
} else {
|
||||
urlSet.add(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
return urlSet;
|
||||
}
|
||||
|
||||
public List<RequestUrlVO> getPrivilegeList() {
|
||||
return this.requestUrlVOS;
|
||||
}
|
||||
|
@ -2,15 +2,15 @@ package net.lab1024.smartadmin.service.module.system.role.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.common.controller.AdminBaseController;
|
||||
import net.lab1024.smartadmin.service.common.controller.SystemBaseController;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.service.RoleService;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleAddForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.vo.RoleVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.service.RoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -23,7 +23,7 @@ import java.util.List;
|
||||
*/
|
||||
@Api(tags = {SwaggerTagConst.System.MANAGER_ROLE})
|
||||
@RestController
|
||||
public class RoleController extends AdminBaseController {
|
||||
public class RoleController extends SystemBaseController {
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
@ -2,14 +2,14 @@ package net.lab1024.smartadmin.service.module.system.role.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import net.lab1024.smartadmin.service.common.controller.AdminBaseController;
|
||||
import net.lab1024.smartadmin.service.common.controller.SystemBaseController;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleDataScopeUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.vo.RoleDataScopeVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.service.RoleDataScopeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
@Api(tags = {SwaggerTagConst.System.MANAGER_ROLE})
|
||||
@RestController
|
||||
public class RoleDataScopeController extends AdminBaseController {
|
||||
public class RoleDataScopeController extends SystemBaseController {
|
||||
|
||||
@Autowired
|
||||
private RoleDataScopeService roleDataScopeService;
|
||||
|
@ -4,18 +4,17 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.common.controller.AdminBaseController;
|
||||
import net.lab1024.smartadmin.service.common.controller.SystemBaseController;
|
||||
import net.lab1024.smartadmin.service.common.domain.PageResult;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.module.system.employee.domain.vo.EmployeeVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleEmployeeQueryForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleEmployeeUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.vo.RoleSelectedVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.service.RoleEmployeeService;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleEmployeeUpdateForm;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -28,7 +27,7 @@ import java.util.List;
|
||||
*/
|
||||
@Api(tags = {SwaggerTagConst.System.MANAGER_ROLE})
|
||||
@RestController
|
||||
public class RoleEmployeeController extends AdminBaseController {
|
||||
public class RoleEmployeeController extends SystemBaseController {
|
||||
|
||||
@Autowired
|
||||
private RoleEmployeeService roleEmployeeService;
|
||||
|
@ -2,14 +2,14 @@ package net.lab1024.smartadmin.service.module.system.role.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import net.lab1024.smartadmin.service.common.controller.AdminBaseController;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.common.controller.SystemBaseController;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.service.RoleMenuService;
|
||||
import net.lab1024.smartadmin.service.constant.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleMenuUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.vo.RoleMenuTreeVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.service.RoleMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@ -21,7 +21,7 @@ import javax.validation.Valid;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = {SwaggerTagConst.System.MANAGER_ROLE_MENU})
|
||||
public class RoleMenuController extends AdminBaseController {
|
||||
public class RoleMenuController extends SystemBaseController {
|
||||
|
||||
@Autowired
|
||||
private RoleMenuService roleMenuService;
|
||||
|
@ -1,15 +1,12 @@
|
||||
package net.lab1024.smartadmin.service.module.system.role.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import net.lab1024.smartadmin.service.common.code.UserErrorCode;
|
||||
import net.lab1024.smartadmin.service.common.constant.CommonConst;
|
||||
import net.lab1024.smartadmin.service.common.constant.StringConst;
|
||||
import net.lab1024.smartadmin.service.common.domain.PageResult;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.common.service.BaseService;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBeanUtil;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartPageUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.department.dao.DepartmentDao;
|
||||
import net.lab1024.smartadmin.service.module.system.department.domain.entity.DepartmentEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.employee.EmployeeCacheService;
|
||||
@ -22,8 +19,10 @@ import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleEmploye
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleEmployeeUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.vo.RoleSelectedVO;
|
||||
import net.lab1024.smartadmin.service.module.system.role.manager.RoleEmployeeManager;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBeanUtil;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartPageUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -36,7 +35,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2019/4/3
|
||||
*/
|
||||
@Service
|
||||
public class RoleEmployeeService extends BaseService {
|
||||
public class RoleEmployeeService {
|
||||
|
||||
@Autowired
|
||||
private RoleEmployeeDao roleEmployeeDao;
|
||||
@ -66,7 +65,7 @@ public class RoleEmployeeService extends BaseService {
|
||||
List<DepartmentEntity> departmentEntities = departmentDao.selectBatchIds(departmentIdList);
|
||||
Map<Long, String> departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getId, DepartmentEntity::getName));
|
||||
employeeDTOS.forEach(e -> {
|
||||
e.setDepartmentName(departmentIdNameMap.getOrDefault(e.getDepartmentId(), CommonConst.EMPTY_STR));
|
||||
e.setDepartmentName(departmentIdNameMap.getOrDefault(e.getDepartmentId(), StringConst.EMPTY_STR));
|
||||
});
|
||||
}
|
||||
PageResult<EmployeeVO> PageResult = SmartPageUtil.convert2PageResult(page, employeeDTOS, EmployeeVO.class);
|
||||
|
@ -1,23 +1,22 @@
|
||||
package net.lab1024.smartadmin.service.module.system.role.service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import net.lab1024.smartadmin.service.common.code.UserErrorCode;
|
||||
import net.lab1024.smartadmin.service.common.constant.CommonConst;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBeanUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.dao.MenuDao;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.service.MenuEmployeeService;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.MenuSimpleTreeVO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.domain.vo.MenuVO;
|
||||
import net.lab1024.smartadmin.service.module.system.menu.service.MenuEmployeeService;
|
||||
import net.lab1024.smartadmin.service.module.system.role.dao.RoleDao;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.entity.RoleEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.role.dao.RoleMenuDao;
|
||||
import net.lab1024.smartadmin.service.module.system.role.manager.RoleMenuManager;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleMenuUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.entity.RoleEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.entity.RoleMenuEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.form.RoleMenuUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.role.domain.vo.RoleMenuTreeVO;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBeanUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.role.manager.RoleMenuManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -32,6 +31,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class RoleMenuService {
|
||||
|
||||
private static final long DEFAULT_PARENT_ID = 0;
|
||||
|
||||
@Autowired
|
||||
private RoleDao roleDao;
|
||||
@Autowired
|
||||
@ -85,7 +86,7 @@ public class RoleMenuService {
|
||||
//查询菜单权限
|
||||
List<MenuVO> menuVOList = menuDao.queryMenuList(Boolean.FALSE, Boolean.FALSE, null);
|
||||
Map<Long, List<MenuVO>> parentMap = menuVOList.stream().collect(Collectors.groupingBy(MenuVO::getParentId, Collectors.toList()));
|
||||
List<MenuSimpleTreeVO> menuTreeList = this.buildMenuTree(parentMap, CommonConst.DEFAULT_PARENT_ID);
|
||||
List<MenuSimpleTreeVO> menuTreeList = this.buildMenuTree(parentMap, DEFAULT_PARENT_ID);
|
||||
res.setMenuTreeList(menuTreeList);
|
||||
return ResponseDTO.ok(res);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class RoleService {
|
||||
public ResponseDTO addRole(RoleAddForm roleAddForm) {
|
||||
RoleEntity employeeRoleEntity = roleDao.getByRoleName(roleAddForm.getRoleName());
|
||||
if (null != employeeRoleEntity) {
|
||||
return ResponseDTO.error(UserErrorCode.ALREADY_EXISTS, "角色名称重复");
|
||||
return ResponseDTO.error(UserErrorCode.ALREADY_EXIST, "角色名称重复");
|
||||
}
|
||||
RoleEntity roleEntity = SmartBeanUtil.copy(roleAddForm, RoleEntity.class);
|
||||
roleDao.insert(roleEntity);
|
||||
@ -81,7 +81,7 @@ public class RoleService {
|
||||
}
|
||||
RoleEntity employeeRoleEntity = roleDao.getByRoleName(roleUpdateForm.getRoleName());
|
||||
if (null != employeeRoleEntity && !employeeRoleEntity.getId().equals(roleUpdateForm.getId())) {
|
||||
return ResponseDTO.error(UserErrorCode.ALREADY_EXISTS, "角色名称重复");
|
||||
return ResponseDTO.error(UserErrorCode.PARAM_ERROR, "角色名称重复");
|
||||
}
|
||||
RoleEntity roleEntity = SmartBeanUtil.copy(roleUpdateForm, RoleEntity.class);
|
||||
roleDao.updateById(roleEntity);
|
||||
|
@ -2,12 +2,14 @@ package net.lab1024.smartadmin.service.module.system.systemconfig;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import net.lab1024.smartadmin.service.common.controller.SupportBaseController;
|
||||
import net.lab1024.smartadmin.service.common.controller.SystemBaseController;
|
||||
import net.lab1024.smartadmin.service.common.domain.PageResult;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.common.swagger.SwaggerTagConst;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBeanUtil;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.*;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigAddForm;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigQueryForm;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigUpdateForm;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -23,35 +25,33 @@ import javax.validation.Valid;
|
||||
*/
|
||||
@Api(tags = {SwaggerTagConst.Support.SYSTEM_CONFIG})
|
||||
@RestController
|
||||
public class SystemConfigController extends SupportBaseController {
|
||||
public class SystemConfigController extends SystemBaseController {
|
||||
|
||||
@Autowired
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@ApiOperation("分页查询系统配置")
|
||||
@PostMapping("/system/config/query")
|
||||
public ResponseDTO<PageResult<SystemConfigVO>> querySystemConfigPage(@RequestBody @Valid SystemConfigQuery queryDTO) {
|
||||
return systemConfigService.queryConfigPage(queryDTO);
|
||||
@PostMapping("/config/query")
|
||||
public ResponseDTO<PageResult<SystemConfigVO>> querySystemConfigPage(@RequestBody @Valid SystemConfigQueryForm queryForm) {
|
||||
return systemConfigService.queryConfigPage(queryForm);
|
||||
}
|
||||
|
||||
@ApiOperation("添加配置参数")
|
||||
@PostMapping("/system/config/add")
|
||||
public ResponseDTO<String> addSystemConfig(@RequestBody @Valid SystemConfigAddDTO configAddDTO) {
|
||||
return systemConfigService.add(configAddDTO);
|
||||
@PostMapping("/config/add")
|
||||
public ResponseDTO<String> addSystemConfig(@RequestBody @Valid SystemConfigAddForm configAddForm) {
|
||||
return systemConfigService.add(configAddForm);
|
||||
}
|
||||
|
||||
@ApiOperation("修改配置参数")
|
||||
@PostMapping("/system/config/update")
|
||||
public ResponseDTO<String> updateSystemConfig(@RequestBody @Valid SystemConfigUpdateDTO updateDTO) {
|
||||
return systemConfigService.updateSystemConfig(updateDTO);
|
||||
@PostMapping("/config/update")
|
||||
public ResponseDTO<String> updateSystemConfig(@RequestBody @Valid SystemConfigUpdateForm updateForm) {
|
||||
return systemConfigService.updateSystemConfig(updateForm);
|
||||
}
|
||||
|
||||
@ApiOperation("查询配置详情")
|
||||
@GetMapping("/system/config/queryByKey")
|
||||
@GetMapping("/config/queryByKey")
|
||||
public ResponseDTO<SystemConfigVO> queryByKey(@RequestParam String configKey) {
|
||||
SystemConfigDTO configDTO = systemConfigService.getConfig(configKey);
|
||||
SystemConfigVO configVO = SmartBeanUtil.copy(configDTO, SystemConfigVO.class);
|
||||
return ResponseDTO.ok(configVO);
|
||||
return ResponseDTO.ok(systemConfigService.getConfig(configKey));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package net.lab1024.smartadmin.service.module.system.systemconfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigEntity;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigQuery;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.SystemConfigQueryForm;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -26,7 +26,7 @@ public interface SystemConfigDao extends BaseMapper<SystemConfigEntity> {
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
List<SystemConfigEntity> queryByPage(Page page, @Param("query") SystemConfigQuery queryDTO);
|
||||
List<SystemConfigEntity> queryByPage(Page page, @Param("query") SystemConfigQueryForm queryDTO);
|
||||
|
||||
/**
|
||||
* 根据key查询获取数据
|
||||
|
@ -6,11 +6,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.smartadmin.service.common.code.UserErrorCode;
|
||||
import net.lab1024.smartadmin.service.common.domain.PageResult;
|
||||
import net.lab1024.smartadmin.service.common.domain.ResponseDTO;
|
||||
import net.lab1024.smartadmin.service.module.support.reload.core.annoation.SmartReload;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.*;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBaseEnumUtil;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartBeanUtil;
|
||||
import net.lab1024.smartadmin.service.common.util.SmartPageUtil;
|
||||
import net.lab1024.smartadmin.service.module.support.reload.core.annoation.SmartReload;
|
||||
import net.lab1024.smartadmin.service.module.system.systemconfig.domain.*;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -64,9 +64,6 @@ public class SystemConfigService {
|
||||
*/
|
||||
private void refreshConfigCache(Long configId) {
|
||||
Optional<SystemConfigEntity> optional = this.CONFIG_CACHE.values().stream().filter(e -> Objects.equals(configId, e.getConfigId())).findFirst();
|
||||
// 移除缓存
|
||||
optional.ifPresent(e -> this.CONFIG_CACHE.remove(e.getConfigKey()));
|
||||
|
||||
// 重新查询 加入缓存
|
||||
SystemConfigEntity configEntity = systemConfigDao.selectById(configId);
|
||||
if (null == configEntity) {
|
||||
@ -81,7 +78,7 @@ public class SystemConfigService {
|
||||
* @param queryDTO
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<PageResult<SystemConfigVO>> queryConfigPage(SystemConfigQuery queryDTO) {
|
||||
public ResponseDTO<PageResult<SystemConfigVO>> queryConfigPage(SystemConfigQueryForm queryDTO) {
|
||||
Page page = SmartPageUtil.convert2PageQuery(queryDTO);
|
||||
List<SystemConfigEntity> entityList = systemConfigDao.queryByPage(page, queryDTO);
|
||||
PageResult<SystemConfigVO> pageResult = SmartPageUtil.convert2PageResult(page, entityList, SystemConfigVO.class);
|
||||
@ -94,7 +91,7 @@ public class SystemConfigService {
|
||||
* @param configKey
|
||||
* @return
|
||||
*/
|
||||
public SystemConfigDTO getConfig(SystemConfigKeyEnum configKey) {
|
||||
public SystemConfigVO getConfig(SystemConfigKeyEnum configKey) {
|
||||
return this.getConfig(configKey.getValue());
|
||||
}
|
||||
|
||||
@ -104,14 +101,14 @@ public class SystemConfigService {
|
||||
* @param configKey
|
||||
* @return
|
||||
*/
|
||||
public SystemConfigDTO getConfig(String configKey) {
|
||||
public SystemConfigVO getConfig(String configKey) {
|
||||
boolean check = SmartBaseEnumUtil.checkEnum(configKey, SystemConfigKeyEnum.class);
|
||||
Assert.isTrue(check, "config key error");
|
||||
|
||||
SystemConfigEntity entity = this.CONFIG_CACHE.get(configKey);
|
||||
Assert.notNull(entity, "缺少系统配置[" + configKey + "]");
|
||||
|
||||
return SmartBeanUtil.copy(entity, SystemConfigDTO.class);
|
||||
return SmartBeanUtil.copy(entity, SystemConfigVO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -143,7 +140,7 @@ public class SystemConfigService {
|
||||
* @param configAddDTO
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> add(SystemConfigAddDTO configAddDTO) {
|
||||
public ResponseDTO<String> add(SystemConfigAddForm configAddDTO) {
|
||||
SystemConfigEntity entity = systemConfigDao.selectByKey(configAddDTO.getConfigKey());
|
||||
if (null != entity) {
|
||||
return ResponseDTO.error(UserErrorCode.ALREADY_EXIST);
|
||||
@ -162,7 +159,7 @@ public class SystemConfigService {
|
||||
* @param updateDTO
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> updateSystemConfig(SystemConfigUpdateDTO updateDTO) {
|
||||
public ResponseDTO<String> updateSystemConfig(SystemConfigUpdateForm updateDTO) {
|
||||
Long configId = updateDTO.getConfigId();
|
||||
SystemConfigEntity entity = systemConfigDao.selectById(configId);
|
||||
if (null == entity) {
|
||||
@ -190,7 +187,7 @@ public class SystemConfigService {
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> updateValueByKey(SystemConfigKeyEnum key, String value) {
|
||||
SystemConfigDTO config = this.getConfig(key);
|
||||
SystemConfigVO config = this.getConfig(key);
|
||||
if (null == config) {
|
||||
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import javax.validation.constraints.NotBlank;
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
public class SystemConfigAddDTO {
|
||||
public class SystemConfigAddForm {
|
||||
|
||||
@ApiModelProperty("参数key")
|
||||
@NotBlank(message = "参数key不能为空")
|
@ -1,38 +0,0 @@
|
||||
package net.lab1024.smartadmin.service.module.system.systemconfig.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author 罗伊
|
||||
* @version 1.0
|
||||
* @date
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
public class SystemConfigDTO {
|
||||
|
||||
@ApiModelProperty("主键")
|
||||
private Long configId;
|
||||
|
||||
@ApiModelProperty("参数key")
|
||||
private String configKey;
|
||||
|
||||
@ApiModelProperty("参数的值")
|
||||
private String configValue;
|
||||
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("上次修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
public class SystemConfigQuery extends PageParam {
|
||||
public class SystemConfigQueryForm extends PageParam {
|
||||
|
||||
@ApiModelProperty("参数KEY")
|
||||
@Length(max = 50, message = "参数Key最多50字符")
|
@ -15,7 +15,7 @@ import javax.validation.constraints.NotNull;
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
public class SystemConfigUpdateDTO extends SystemConfigAddDTO {
|
||||
public class SystemConfigUpdateForm extends SystemConfigAddForm {
|
||||
|
||||
@ApiModelProperty("configId")
|
||||
@NotNull(message = "configId不能为空")
|
@ -1,13 +1,35 @@
|
||||
package net.lab1024.smartadmin.service.module.system.systemconfig.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 系统配置 vo
|
||||
*
|
||||
* @author huke
|
||||
*/
|
||||
@Data
|
||||
public class SystemConfigVO extends SystemConfigDTO {
|
||||
public class SystemConfigVO {
|
||||
@ApiModelProperty("主键")
|
||||
private Long configId;
|
||||
|
||||
@ApiModelProperty("参数key")
|
||||
private String configKey;
|
||||
|
||||
@ApiModelProperty("参数的值")
|
||||
private String configValue;
|
||||
|
||||
@ApiModelProperty("参数名称")
|
||||
private String configName;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("上次修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
@ -1,84 +0,0 @@
|
||||
package net.lab1024.smartadmin.service.third;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* [ ApplicationContextHelper ]
|
||||
*
|
||||
* @author 罗伊
|
||||
* @date 2020/8/25 11:57
|
||||
*/
|
||||
@Component
|
||||
public class SmartApplicationContext implements ApplicationContextAware {
|
||||
|
||||
/**
|
||||
* 上下文对象实例
|
||||
*/
|
||||
private static ApplicationContext applicationContext = null;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
if (SmartApplicationContext.applicationContext == null) {
|
||||
|
||||
SmartApplicationContext.applicationContext = applicationContext;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取applicationContext
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过name获取 Bean.
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static Object getBean(String name) {
|
||||
ApplicationContext applicationContext = getApplicationContext();
|
||||
if (applicationContext == null) {
|
||||
return null;
|
||||
}
|
||||
return applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过class获取Bean.
|
||||
*
|
||||
* @param clazz
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getBean(Class<T> clazz) {
|
||||
ApplicationContext applicationContext = getApplicationContext();
|
||||
if (applicationContext == null) {
|
||||
return null;
|
||||
}
|
||||
return applicationContext.getBean(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过name,以及Clazz返回指定的Bean
|
||||
*
|
||||
* @param name
|
||||
* @param clazz
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getBean(String name, Class<T> clazz) {
|
||||
ApplicationContext applicationContext = getApplicationContext();
|
||||
if (applicationContext == null) {
|
||||
return null;
|
||||
}
|
||||
return applicationContext.getBean(name, clazz);
|
||||
}
|
||||
}
|
@ -22,9 +22,14 @@ spring.jackson.time-zone=GMT+8
|
||||
spring.jackson.serialization.write-dates-as-timestamps=false
|
||||
|
||||
######################### database #########################
|
||||
spring.datasource.url=jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
#spring.datasource.url=jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
#spring.datasource.username=root
|
||||
#spring.datasource.password=root
|
||||
|
||||
spring.datasource.url=jdbc:p6spy:mysql://82.157.125.186:10200/smart_admin_v2?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
spring.datasource.password=Zhuoda.vip
|
||||
|
||||
spring.datasource.initial-size=2
|
||||
spring.datasource.min-idle=1
|
||||
spring.datasource.max-active=10
|
||||
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.smartadmin.service.module.system.pay.wx.account.WxPayAccountDao">
|
||||
|
||||
<!-- 根据 微信应用类型 查询微信支付账户 -->
|
||||
<select id="selectAppType"
|
||||
resultType="net.lab1024.smartadmin.service.module.system.pay.wx.account.domain.WxPayAccountEntity">
|
||||
SELECT * FROM t_wx_pay_account
|
||||
WHERE app_type = #{appType}
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.smartadmin.service.module.system.pay.wx.record.WxPayRecordDao">
|
||||
|
||||
<!-- 查询 未支付完成 或者 业务未处理的数据 -->
|
||||
<select id="queryNotComplete"
|
||||
resultType="net.lab1024.smartadmin.service.module.system.pay.wx.record.domain.WxPayRecordEntity">
|
||||
SELECT * FROM t_wx_pay_record
|
||||
WHERE complete_time IS NULL OR business_handle_flag = #{handleFlag}
|
||||
</select>
|
||||
|
||||
<!-- 根据 业务 查询1条支付记录 -->
|
||||
<select id="selectOneByBusiness"
|
||||
resultType="net.lab1024.smartadmin.service.module.system.pay.wx.record.domain.WxPayRecordEntity">
|
||||
SELECT * FROM t_wx_pay_record
|
||||
WHERE business_id = #{businessId} AND business_type = #{businessType}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 根据 支付单号 查询1条支付记录 -->
|
||||
<select id="selectOneByPayNo"
|
||||
resultType="net.lab1024.smartadmin.service.module.system.pay.wx.record.domain.WxPayRecordEntity">
|
||||
SELECT * FROM t_wx_pay_record
|
||||
WHERE payment_no = #{paymentNo}
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.smartadmin.service.module.system.pay.wx.record.WxPayRefundRecordDao">
|
||||
|
||||
|
||||
<!-- 根据退款状态 或 业务处理状态 查询 -->
|
||||
<select id="queryByRefundStatusOrHandleFlag"
|
||||
resultType="net.lab1024.smartadmin.service.module.system.pay.wx.record.domain.WxPayRefundRecordEntity">
|
||||
SELECT * FROM t_wx_pay_refund_record
|
||||
WHERE refund_status = #{refundStatus} OR business_handle_flag = #{handleFlag}
|
||||
<if test="limit != null">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 根据 退款单号 查询1条数据 -->
|
||||
<select id="selectByRefundNo"
|
||||
resultType="net.lab1024.smartadmin.service.module.system.pay.wx.record.domain.WxPayRefundRecordEntity">
|
||||
SELECT * FROM t_wx_pay_refund_record
|
||||
WHERE refund_no = #{refundNo}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.smartadmin.service.module.system.position.employee.PositionEmployeeDao">
|
||||
|
||||
<delete id="delByEmployeeId">
|
||||
DELETE FROM t_position_employee WHERE employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
<!-- 查询员工岗位信息 -->
|
||||
<select id="listByEmployeeId" resultType="net.lab1024.smartadmin.service.module.system.position.employee.domain.PositionEmployeeBaseVO">
|
||||
SELECT
|
||||
job.position_name,
|
||||
rel.*
|
||||
FROM
|
||||
t_position_employee rel
|
||||
LEFT JOIN t_position job ON rel.position_id = job.id
|
||||
<where>
|
||||
rel.employee_id IN
|
||||
<foreach collection="employeeIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.smartadmin.service.module.system.position.basic.PositionDao">
|
||||
|
||||
<select id="selectByPage" resultType="net.lab1024.smartadmin.service.module.system.position.basic.domain.entity.PositionEntity">
|
||||
SELECT *
|
||||
FROM t_position
|
||||
<where>
|
||||
<if test="queryDTO.positionName != null and queryDTO.positionName != ''">
|
||||
AND INSTR(position_name,#{queryDTO.positionName})
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRelation" resultType="net.lab1024.smartadmin.service.module.system.position.employee.domain.PositionEmployeeBaseVO">
|
||||
SELECT
|
||||
job.position_name,
|
||||
rel.position_id,
|
||||
rel.employee_id,
|
||||
rel.update_time,
|
||||
rel.create_time
|
||||
FROM
|
||||
t_position_employee rel
|
||||
LEFT JOIN t_position job ON rel.position_id = job.id
|
||||
<where>
|
||||
<if test="positionId != null">
|
||||
AND rel.position_id = #{positionId}
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
AND rel.employee_id = #{employeeId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.smartadmin.service.module.system.role.dao.RoleDataScopeDao">
|
||||
|
||||
<resultMap id="DataScopeRoleEntity" type="net.lab1024.smartadmin.service.module.system.datascope.domain.entity.DataScopeRoleEntity"></resultMap>
|
||||
<resultMap id="DataScopeRoleEntity" type="net.lab1024.smartadmin.service.module.support.datascope.domain.entity.DataScopeRoleEntity"></resultMap>
|
||||
|
||||
<select id="listByRoleId" resultMap="DataScopeRoleEntity">
|
||||
select id,data_scope_type,view_type,role_id,update_time,create_time from t_role_data_scope where role_id = #{roleId}
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- --------------------------------------------------------
|
||||
-- 主机: 127.0.0.1
|
||||
-- 服务器版本: 8.0.20 - MySQL Community Server - GPL
|
||||
-- 服务器操作系统: Win64
|
||||
-- 主机: 82.157.125.186
|
||||
-- 服务器版本: 8.0.26 - MySQL Community Server - GPL
|
||||
-- 服务器操作系统: Linux
|
||||
-- HeidiSQL 版本: 11.0.0.5919
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -30,7 +30,7 @@ CREATE TABLE IF NOT EXISTS `t_area` (
|
||||
PRIMARY KEY (`area_code`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='公用服务 - 地区数据表 listen';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_area 的数据:~11 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_area 的数据:~3,434 rows (大约)
|
||||
DELETE FROM `t_area`;
|
||||
/*!40000 ALTER TABLE `t_area` DISABLE KEYS */;
|
||||
INSERT INTO `t_area` (`area_code`, `parent_code`, `area_name`, `full_name`, `depth`, `update_time`, `create_time`) VALUES
|
||||
@ -3541,7 +3541,6 @@ CREATE TABLE IF NOT EXISTS `t_employee` (
|
||||
`phone` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '手机号码',
|
||||
`department_id` int NOT NULL COMMENT '部门id',
|
||||
`disabled_flag` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否被禁用 0否1是',
|
||||
`deleted_flag` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除0否 1是',
|
||||
`remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
@ -3551,12 +3550,12 @@ CREATE TABLE IF NOT EXISTS `t_employee` (
|
||||
-- 正在导出表 smart_admin_v2.t_employee 的数据:~5 rows (大约)
|
||||
DELETE FROM `t_employee`;
|
||||
/*!40000 ALTER TABLE `t_employee` DISABLE KEYS */;
|
||||
INSERT INTO `t_employee` (`id`, `login_name`, `login_pwd`, `actual_name`, `gender`, `phone`, `department_id`, `disabled_flag`, `deleted_flag`, `remark`, `update_time`, `create_time`) VALUES
|
||||
(1, 'sa', 'c655798e4648c540812a1b8f48759af7', '管理员', 0, '13592000000', 30, 0, 0, NULL, '2021-09-01 22:18:36', '2018-05-11 09:38:54'),
|
||||
(2, 'huke', 'c655798e4648c540812a1b8f48759af7', '胡克', 0, '13123123123', 1, 0, 0, NULL, '2021-09-01 22:25:38', '2021-07-29 11:24:55'),
|
||||
(44, 'bonjour', 'c655798e4648c540812a1b8f48759af7', 'string', 1, '15194550204', 1, 0, 1, NULL, '2021-09-01 22:18:38', '2021-08-11 10:04:53'),
|
||||
(47, 'shanyi', 'c655798e4648c540812a1b8f48759af7', '善逸', 1, '13123123123', 1, 0, 0, NULL, '2021-09-01 22:25:32', '2021-08-16 17:14:55'),
|
||||
(48, 'qinjiu', 'c655798e4648c540812a1b8f48759af7', '琴酒', 2, '17366273884', 1, 0, 0, NULL, '2021-09-01 22:25:53', '2021-08-17 10:29:41');
|
||||
INSERT INTO `t_employee` (`id`, `login_name`, `login_pwd`, `actual_name`, `gender`, `phone`, `department_id`, `disabled_flag`, `remark`, `update_time`, `create_time`) VALUES
|
||||
(1, 'sa', 'c655798e4648c540812a1b8f48759af7', '管理员', 0, '13592000000', 30, 0, NULL, '2021-09-01 22:18:36', '2018-05-11 09:38:54'),
|
||||
(2, 'huke', 'c655798e4648c540812a1b8f48759af7', '胡克', 0, '13123123123', 1, 0, NULL, '2021-09-01 22:25:38', '2021-07-29 11:24:55'),
|
||||
(44, 'bonjour', 'c655798e4648c540812a1b8f48759af7', 'string', 1, '15194550204', 1, 0, NULL, '2021-09-01 22:18:38', '2021-08-11 10:04:53'),
|
||||
(47, 'shanyi', 'c655798e4648c540812a1b8f48759af7', '善逸', 1, '13123123123', 1, 0, NULL, '2021-09-01 22:25:32', '2021-08-16 17:14:55'),
|
||||
(48, 'qinjiu', 'c655798e4648c540812a1b8f48759af7', '琴酒', 2, '17366273884', 1, 0, NULL, '2021-09-01 22:25:53', '2021-08-17 10:29:41');
|
||||
/*!40000 ALTER TABLE `t_employee` ENABLE KEYS */;
|
||||
|
||||
-- 导出 表 smart_admin_v2.t_file 结构
|
||||
@ -3611,11 +3610,28 @@ INSERT INTO `t_goods` (`goods_id`, `goods_type`, `category_id`, `goods_name`, `g
|
||||
(3, 1, 1, '深入理解Java虚拟机', '', '', 103.00, 1, 0, NULL, '2021-09-01 22:33:37', '2021-09-01 22:33:37');
|
||||
/*!40000 ALTER TABLE `t_goods` ENABLE KEYS */;
|
||||
|
||||
-- 导出 表 smart_admin_v2.t_heart_beat_record 结构
|
||||
DROP TABLE IF EXISTS `t_heart_beat_record`;
|
||||
CREATE TABLE IF NOT EXISTS `t_heart_beat_record` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`project_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目名称',
|
||||
`server_ip` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务器ip',
|
||||
`process_no` int NOT NULL COMMENT '进程号',
|
||||
`process_start_time` datetime NOT NULL COMMENT '进程开启时间',
|
||||
`heart_beat_time` datetime NOT NULL COMMENT '心跳时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='公用服务 - 服务心跳';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_heart_beat_record 的数据:~0 rows (大约)
|
||||
DELETE FROM `t_heart_beat_record`;
|
||||
/*!40000 ALTER TABLE `t_heart_beat_record` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `t_heart_beat_record` ENABLE KEYS */;
|
||||
|
||||
-- 导出 表 smart_admin_v2.t_id_generator 结构
|
||||
DROP TABLE IF EXISTS `t_id_generator`;
|
||||
CREATE TABLE IF NOT EXISTS `t_id_generator` (
|
||||
`id` int unsigned NOT NULL,
|
||||
`key_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '英文key',
|
||||
`business_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '英文key',
|
||||
`prefix` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前缀',
|
||||
`min_length` tinyint unsigned NOT NULL COMMENT '最低补位长度',
|
||||
`rule_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ' 无周期 年周期 月周期 天周期',
|
||||
@ -3625,13 +3641,13 @@ CREATE TABLE IF NOT EXISTS `t_id_generator` (
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `key_name` (`key_name`) USING BTREE
|
||||
UNIQUE KEY `key_name` (`business_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='id生成器定义表';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_id_generator 的数据:~2 rows (大约)
|
||||
DELETE FROM `t_id_generator`;
|
||||
/*!40000 ALTER TABLE `t_id_generator` DISABLE KEYS */;
|
||||
INSERT INTO `t_id_generator` (`id`, `key_name`, `prefix`, `min_length`, `rule_type`, `init_number`, `step_random_range`, `remark`, `update_time`, `create_time`) VALUES
|
||||
INSERT INTO `t_id_generator` (`id`, `business_name`, `prefix`, `min_length`, `rule_type`, `init_number`, `step_random_range`, `remark`, `update_time`, `create_time`) VALUES
|
||||
(1, 'order', NULL, 6, 'DAY_CYCLE', 10000, 100, '订单id生成', '2021-08-11 11:13:20', '2021-02-19 14:37:50'),
|
||||
(2, 'contract', NULL, 6, 'DAY_CYCLE', 1, 1, '合同id生成', '2021-08-12 20:40:37', '2021-08-12 20:40:37');
|
||||
/*!40000 ALTER TABLE `t_id_generator` ENABLE KEYS */;
|
||||
@ -3650,7 +3666,7 @@ CREATE TABLE IF NOT EXISTS `t_id_generator_record` (
|
||||
PRIMARY KEY (`generator_id`,`year`,`month`,`day`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='id_generator记录表';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_id_generator_record 的数据:~21 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_id_generator_record 的数据:~0 rows (大约)
|
||||
DELETE FROM `t_id_generator_record`;
|
||||
/*!40000 ALTER TABLE `t_id_generator_record` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `t_id_generator_record` ENABLE KEYS */;
|
||||
@ -3689,6 +3705,7 @@ CREATE TABLE IF NOT EXISTS `t_menu` (
|
||||
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '路由地址',
|
||||
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '组件路径',
|
||||
`perms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '权限字符串',
|
||||
`web_perms` mediumtext COMMENT '前端权限字符串',
|
||||
`icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '菜单图标',
|
||||
`context_menu_id` bigint DEFAULT NULL COMMENT '功能点关联菜单ID',
|
||||
`frame_flag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为外链',
|
||||
@ -3706,18 +3723,18 @@ CREATE TABLE IF NOT EXISTS `t_menu` (
|
||||
-- 正在导出表 smart_admin_v2.t_menu 的数据:~11 rows (大约)
|
||||
DELETE FROM `t_menu`;
|
||||
/*!40000 ALTER TABLE `t_menu` DISABLE KEYS */;
|
||||
INSERT INTO `t_menu` (`menu_id`, `menu_name`, `menu_type`, `parent_id`, `sort`, `path`, `component`, `perms`, `icon`, `context_menu_id`, `frame_flag`, `cache_flag`, `visible_flag`, `disabled_flag`, `delete_flag`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES
|
||||
(25, '菜单', 1, 0, 10, '/menu', NULL, '', 'CopyOutlined', NULL, 0, 0, 1, 0, 1, 2, '2021-08-09 15:02:42', 1, '2021-09-01 22:25:53'),
|
||||
(26, '菜单管理', 2, 45, 0, '/menu/list', '/system/menu/menu-list.vue', '', 'CopyOutlined', NULL, 0, 0, 1, 0, 0, 2, '2021-08-09 15:04:35', 1, '2021-09-01 22:25:28'),
|
||||
(40, '查询', 3, 26, NULL, NULL, NULL, 'MenuController.queryMenuList', NULL, 76, 0, 0, 1, 0, 0, 1, '2021-08-12 09:45:56', 1, '2021-09-01 21:09:54'),
|
||||
(45, '系统', 1, 0, 2, '/system', NULL, NULL, 'SettingFilled', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 16:13:27', 1, '2021-09-01 22:27:23'),
|
||||
(46, '组织架构', 2, 45, 1, '/employee/department', '/system/employee/department/index.vue', NULL, 'UngroupOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 16:21:50', 1, '2021-08-26 10:32:14'),
|
||||
(47, '商品管理', 2, 48, 3, '/goods/list', '/business/goods/goods-list.vue', NULL, 'InboxOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 17:58:39', 1, '2021-08-12 18:09:02'),
|
||||
(48, '商品', 1, 0, 1, '/goods', NULL, NULL, 'AppstoreOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 18:02:59', 1, '2021-09-01 22:27:28'),
|
||||
(50, '设置', 1, 0, 5, '/setting', NULL, NULL, 'SettingOutlined', NULL, 0, 0, 1, 0, 1, 1, '2021-08-13 16:41:33', 1, '2021-09-01 22:25:50'),
|
||||
(52, '商品分类', 2, 48, 0, '/setting/goods-setting', '/business/setting/goods-setting.vue', NULL, 'FileDoneOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-13 16:42:28', 1, '2021-09-01 22:28:32'),
|
||||
(76, '角色管理', 2, 45, 2, '/employee/role', '/system/employee/role/index.vue', NULL, 'InsertRowRightOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-26 10:31:00', 1, '2021-08-26 10:32:18'),
|
||||
(77, '类目', 2, 48, 5, '/goods/demo', '/business/setting/demo-setting.vue', NULL, 'InsertRowRightOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-09-01 22:34:40', 1, '2021-09-01 22:37:13');
|
||||
INSERT INTO `t_menu` (`menu_id`, `menu_name`, `menu_type`, `parent_id`, `sort`, `path`, `component`, `perms`, `web_perms`, `icon`, `context_menu_id`, `frame_flag`, `cache_flag`, `visible_flag`, `disabled_flag`, `delete_flag`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES
|
||||
(25, '菜单', 1, 0, 10, '/menu', NULL, '', NULL, 'CopyOutlined', NULL, 0, 0, 1, 0, 1, 2, '2021-08-09 15:02:42', 1, '2021-09-01 22:25:53'),
|
||||
(26, '菜单管理', 2, 45, 0, '/menu/list', '/system/menu/menu-list.vue', '', NULL, 'CopyOutlined', NULL, 0, 0, 1, 0, 0, 2, '2021-08-09 15:04:35', 1, '2021-09-01 22:25:28'),
|
||||
(40, '查询', 3, 26, NULL, NULL, NULL, 'MenuController.queryMenuList', NULL, NULL, 76, 0, 0, 1, 0, 0, 1, '2021-08-12 09:45:56', 1, '2021-09-01 21:09:54'),
|
||||
(45, '系统', 1, 0, 2, '/system', NULL, NULL, NULL, 'SettingFilled', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 16:13:27', 1, '2021-09-01 22:27:23'),
|
||||
(46, '组织架构', 2, 45, 1, '/employee/department', '/system/employee/department/index.vue', NULL, NULL, 'UngroupOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 16:21:50', 1, '2021-08-26 10:32:14'),
|
||||
(47, '商品管理', 2, 48, 3, '/goods/list', '/business/goods/goods-list.vue', NULL, NULL, 'InboxOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 17:58:39', 1, '2021-08-12 18:09:02'),
|
||||
(48, '商品', 1, 0, 1, '/goods', NULL, NULL, NULL, 'AppstoreOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-12 18:02:59', 1, '2021-09-01 22:27:28'),
|
||||
(50, '设置', 1, 0, 5, '/setting', NULL, NULL, NULL, 'SettingOutlined', NULL, 0, 0, 1, 0, 1, 1, '2021-08-13 16:41:33', 1, '2021-09-01 22:25:50'),
|
||||
(52, '商品分类', 2, 48, 0, '/setting/goods-setting', '/business/setting/goods-setting.vue', NULL, NULL, 'FileDoneOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-13 16:42:28', 1, '2021-09-01 22:28:32'),
|
||||
(76, '角色管理', 2, 45, 2, '/employee/role', '/system/employee/role/index.vue', NULL, NULL, 'InsertRowRightOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-08-26 10:31:00', 1, '2021-08-26 10:32:18'),
|
||||
(77, '类目', 2, 48, 5, '/goods/demo', '/business/setting/demo-setting.vue', NULL, NULL, 'InsertRowRightOutlined', NULL, 0, 0, 1, 0, 0, 1, '2021-09-01 22:34:40', 1, '2021-09-01 22:37:13');
|
||||
/*!40000 ALTER TABLE `t_menu` ENABLE KEYS */;
|
||||
|
||||
-- 导出 表 smart_admin_v2.t_notice 结构
|
||||
@ -3830,7 +3847,7 @@ CREATE TABLE IF NOT EXISTS `t_position_employee` (
|
||||
UNIQUE KEY `uk_position_employee` (`position_id`,`employee_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位员工 数据表';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_position_employee 的数据:~0 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_position_employee 的数据:~3 rows (大约)
|
||||
DELETE FROM `t_position_employee`;
|
||||
/*!40000 ALTER TABLE `t_position_employee` DISABLE KEYS */;
|
||||
INSERT INTO `t_position_employee` (`id`, `position_id`, `employee_id`, `update_time`, `create_time`) VALUES
|
||||
@ -3871,6 +3888,8 @@ CREATE TABLE IF NOT EXISTS `t_reload_result` (
|
||||
-- 正在导出表 smart_admin_v2.t_reload_result 的数据:~0 rows (大约)
|
||||
DELETE FROM `t_reload_result`;
|
||||
/*!40000 ALTER TABLE `t_reload_result` DISABLE KEYS */;
|
||||
INSERT INTO `t_reload_result` (`tag`, `identification`, `args`, `result`, `exception`, `create_time`) VALUES
|
||||
('system_config', 'xxxx', '235', 1, NULL, '2021-11-02 19:18:05');
|
||||
/*!40000 ALTER TABLE `t_reload_result` ENABLE KEYS */;
|
||||
|
||||
-- 导出 表 smart_admin_v2.t_role 结构
|
||||
@ -3882,9 +3901,9 @@ CREATE TABLE IF NOT EXISTS `t_role` (
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='角色表';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb3 COMMENT='角色表';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_role 的数据:~0 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_role 的数据:~9 rows (大约)
|
||||
DELETE FROM `t_role`;
|
||||
/*!40000 ALTER TABLE `t_role` DISABLE KEYS */;
|
||||
INSERT INTO `t_role` (`id`, `role_name`, `remark`, `update_time`, `create_time`) VALUES
|
||||
@ -3930,7 +3949,7 @@ CREATE TABLE IF NOT EXISTS `t_role_employee` (
|
||||
UNIQUE KEY `uk_role_employee` (`role_id`,`employee_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=288 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色员工功能表';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_role_employee 的数据:~0 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_role_employee 的数据:~2 rows (大约)
|
||||
DELETE FROM `t_role_employee`;
|
||||
/*!40000 ALTER TABLE `t_role_employee` DISABLE KEYS */;
|
||||
INSERT INTO `t_role_employee` (`id`, `role_id`, `employee_id`, `update_time`, `create_time`) VALUES
|
||||
@ -3949,7 +3968,7 @@ CREATE TABLE IF NOT EXISTS `t_role_menu` (
|
||||
PRIMARY KEY (`role_menu_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色-菜单\n';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_role_menu 的数据:~0 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_role_menu 的数据:~61 rows (大约)
|
||||
DELETE FROM `t_role_menu`;
|
||||
/*!40000 ALTER TABLE `t_role_menu` DISABLE KEYS */;
|
||||
INSERT INTO `t_role_menu` (`role_menu_id`, `role_id`, `menu_id`, `update_time`, `create_time`) VALUES
|
||||
@ -4072,23 +4091,12 @@ CREATE TABLE IF NOT EXISTS `t_system_config` (
|
||||
PRIMARY KEY (`config_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `t_heart_beat_record`;
|
||||
CREATE TABLE `t_heart_beat_record` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`project_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目名称',
|
||||
`server_ip` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务器ip',
|
||||
`process_no` int NOT NULL COMMENT '进程号',
|
||||
`process_start_time` datetime NOT NULL COMMENT '进程开启时间',
|
||||
`heart_beat_time` datetime NOT NULL COMMENT '心跳时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='公用服务 - 服务心跳';
|
||||
|
||||
-- 正在导出表 smart_admin_v2.t_system_config 的数据:~0 rows (大约)
|
||||
-- 正在导出表 smart_admin_v2.t_system_config 的数据:~2 rows (大约)
|
||||
DELETE FROM `t_system_config`;
|
||||
/*!40000 ALTER TABLE `t_system_config` DISABLE KEYS */;
|
||||
INSERT INTO `t_system_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_group`, `disabled_flag`, `remark`, `update_time`, `create_time`) VALUES
|
||||
(1, '超级管理员', 'employee_superman', '1,2,52,53,58,56', 'system', 1, '123r8566456', '2021-09-01 17:55:02', '2018-08-18 16:28:03'),
|
||||
(2, '商品', 'xxx', '11', 'system', 1, NULL, '2021-09-01 22:32:18', '2021-08-10 14:33:47');
|
||||
INSERT INTO `t_system_config` (`config_id`, `config_name`, `config_key`, `config_value`, `remark`, `update_time`, `create_time`) VALUES
|
||||
(1, '超级管理员', 'employee_superman', '1,2,52,53,58,56', '123r8566456', '2021-09-01 17:55:02', '2018-08-18 16:28:03'),
|
||||
(2, '商品', 'xxx', '11', NULL, '2021-09-01 22:32:18', '2021-08-10 14:33:47');
|
||||
/*!40000 ALTER TABLE `t_system_config` ENABLE KEYS */;
|
||||
|
||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
||||
|
Loading…
Reference in New Issue
Block a user