diff --git a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictData.java b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictData.java index b6bfe85d..9f7b9c2a 100644 --- a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictData.java +++ b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictData.java @@ -14,11 +14,15 @@ import java.util.List; */ public interface ISysDictData extends ICommonData { + /** + * 按条件查询 + */ + List findByConditions(SysDictData query); + /** * 按条件分页查询 */ - Paging findByConditions(String dictType, String dictValue, - String status, int page, int size); + Paging findByConditions(SysDictData query, int page, int size); /** * 根据字典类型和字典键值查询字典数据信息 @@ -37,4 +41,12 @@ public interface ISysDictData extends ICommonData { */ List findByDicType(String dictType); + /** + * 根据字典类型查询字典数据数量 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + long countByDicType(String dictType); + } diff --git a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictTypeData.java b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictTypeData.java index 92b0f12e..fe98af34 100644 --- a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictTypeData.java +++ b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysDictTypeData.java @@ -4,6 +4,8 @@ import cc.iotkit.data.ICommonData; import cc.iotkit.common.api.Paging; import cc.iotkit.model.system.SysDictType; +import java.util.List; + /** * 字典类型数据接口 * @@ -11,11 +13,15 @@ import cc.iotkit.model.system.SysDictType; */ public interface ISysDictTypeData extends ICommonData { + /** + * 按条件查询 + */ + List findByConditions(SysDictType cond); + /** * 按条件分页查询 */ - Paging findByConditions(String dictName, String dictType, - String status, int page, int size); + Paging findByConditions(SysDictType cond, int page, int size); /** * 根据字典类型查询信息 @@ -25,4 +31,12 @@ public interface ISysDictTypeData extends ICommonData { */ SysDictType findByDicType(String dictType); + /** + * 修改字典类型 + * + * @param dictType 类型 + * @param newType 新类型 + */ + void updateDicType(String dictType, String newType); + } diff --git a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysLogininforData.java b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysLogininforData.java index 98256f40..f3a4f063 100644 --- a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysLogininforData.java +++ b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/system/ISysLogininforData.java @@ -4,6 +4,8 @@ import cc.iotkit.data.ICommonData; import cc.iotkit.common.api.Paging; import cc.iotkit.model.system.SysLogininfor; +import java.util.List; + /** * 登录记录数据接口 * @@ -11,11 +13,15 @@ import cc.iotkit.model.system.SysLogininfor; */ public interface ISysLogininforData extends ICommonData { + /** + * 按条件查询 + */ + List findByConditions(SysLogininfor cond); + /** * 按条件分页查询 */ - Paging findByConditions(String tenantId, String userName, - String status, int page, int size); + Paging findByConditions(SysLogininfor cond, int page, int size); /** * 按租户清除登录日志 @@ -24,4 +30,8 @@ public interface ISysLogininforData extends ICommonData { */ void deleteByTenantId(String tenantId); + /** + * 清除所有 + */ + void deleteAll(); } diff --git a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java index 4d34a4dd..a648fb2f 100644 --- a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java +++ b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java @@ -8,7 +8,6 @@ import cc.iotkit.common.api.Paging; import cc.iotkit.model.system.SysConfig; import java.util.List; -import io.github.linpeilie.Converter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; @@ -68,4 +67,9 @@ public class SysConfigDataImpl implements ISysConfigData { public Paging findConfigs(SysConfig query) { return null; } + + @Override + public SysConfig findByConfigKey(String configKey) { + return null; + } } diff --git a/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/aspect/LogAspect.java b/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/aspect/LogAspect.java index de244dcd..f3088ccf 100644 --- a/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/aspect/LogAspect.java +++ b/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/aspect/LogAspect.java @@ -12,8 +12,6 @@ import cn.hutool.core.lang.Dict; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.ttl.TransmittableThreadLocal; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.time.StopWatch; import org.aspectj.lang.JoinPoint; @@ -26,6 +24,8 @@ import org.springframework.http.HttpMethod; import org.springframework.validation.BindingResult; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.Collection; import java.util.Map; diff --git a/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java b/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java index 8d63cf32..b0703181 100644 --- a/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java +++ b/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java @@ -1,9 +1,8 @@ package cc.iotkit.common.log.event; +import cn.hutool.http.useragent.UserAgent; import lombok.Data; -import jakarta.servlet.http.HttpServletRequest; - import java.io.Serializable; /** @@ -37,9 +36,14 @@ public class LogininforEvent implements Serializable { private String message; /** - * 请求体 + * ip */ - private HttpServletRequest request; + private String ip; + + /** + * user-agent + */ + private UserAgent userAgent; /** * 其他参数 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java index 71dcdc63..80e67513 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java @@ -10,11 +10,11 @@ import cc.iotkit.system.dto.bo.SysConfigBo; import cc.iotkit.system.dto.vo.SysConfigVo; import cn.dev33.satoken.annotation.SaCheckPermission; import cc.iotkit.system.service.ISysConfigService; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java index ae0905c0..67c19044 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java @@ -11,11 +11,11 @@ import cc.iotkit.system.service.ISysDictDataService; import cc.iotkit.system.service.ISysDictTypeService; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.util.ObjectUtil; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java index 502f599d..99aa31f3 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java @@ -10,11 +10,11 @@ import cc.iotkit.system.dto.bo.SysDictTypeBo; import cc.iotkit.system.dto.vo.SysDictTypeVo; import cn.dev33.satoken.annotation.SaCheckPermission; import cc.iotkit.system.service.ISysDictTypeService; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssController.java index 190fe918..f9fb0a18 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssController.java @@ -13,7 +13,6 @@ import cc.iotkit.system.dto.vo.SysOssVo; import cc.iotkit.system.service.ISysOssService; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.util.ObjectUtil; -import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.NotEmpty; import lombok.RequiredArgsConstructor; import org.springframework.http.MediaType; @@ -21,6 +20,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Arrays; import java.util.List; diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java index 00a8976f..047ead9f 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java @@ -10,11 +10,11 @@ import cc.iotkit.system.dto.bo.SysPostBo; import cc.iotkit.system.dto.vo.SysPostVo; import cn.dev33.satoken.annotation.SaCheckPermission; import cc.iotkit.system.service.ISysPostService; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java index 89fc349c..33961102 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java @@ -17,11 +17,11 @@ import cn.dev33.satoken.annotation.SaCheckPermission; import cc.iotkit.system.service.ISysDeptService; import cc.iotkit.system.service.ISysRoleService; import cc.iotkit.system.service.ISysUserService; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java index 4c071a06..1344ca62 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java @@ -6,7 +6,6 @@ import cc.iotkit.common.api.Paging; import cc.iotkit.common.excel.utils.ExcelUtil; import cc.iotkit.common.log.annotation.Log; import cc.iotkit.common.log.enums.BusinessType; -import cc.iotkit.common.tenant.helper.TenantHelper; import cc.iotkit.common.validate.AddGroup; import cc.iotkit.common.validate.EditGroup; import cc.iotkit.common.web.core.BaseController; @@ -15,7 +14,6 @@ import cc.iotkit.system.dto.vo.SysTenantVo; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckRole; import com.baomidou.lock.annotation.Lock4j; -import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; @@ -31,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantPackageController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantPackageController.java index 477cbc6a..b9c883eb 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantPackageController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantPackageController.java @@ -14,13 +14,13 @@ import cc.iotkit.system.dto.vo.SysTenantPackageVo; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckRole; import cc.iotkit.system.service.ISysTenantPackageService; -import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java index 3ef7c9cd..5ee17c86 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java @@ -22,7 +22,6 @@ import cn.dev33.satoken.secure.BCrypt; import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import cc.iotkit.system.listener.SysUserImportListener; import org.springframework.http.MediaType; @@ -30,6 +29,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictDataBo.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictDataBo.java index a5219d6c..775cdbc3 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictDataBo.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictDataBo.java @@ -26,7 +26,7 @@ public class SysDictDataBo extends BaseDto { * 字典编码 */ @NotNull(message = "字典编码不能为空", groups = { EditGroup.class }) - private Long dictCode; + private Long id; /** * 字典排序 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictTypeBo.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictTypeBo.java index 594c2c5f..7d4b526e 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictTypeBo.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysDictTypeBo.java @@ -27,7 +27,7 @@ public class SysDictTypeBo extends BaseDto { * 字典主键 */ @NotNull(message = "字典主键不能为空", groups = { EditGroup.class }) - private Long dictId; + private Long id; /** * 字典名称 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysLogininforBo.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysLogininforBo.java index 65d54d8f..04e592b5 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysLogininforBo.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysLogininforBo.java @@ -21,7 +21,7 @@ public class SysLogininforBo { /** * 访问ID */ - private Long infoId; + private Long id; /** * 租户编号 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictDataVo.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictDataVo.java index 268d3d9c..406d22ce 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictDataVo.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictDataVo.java @@ -27,7 +27,7 @@ public class SysDictDataVo implements Serializable { * 字典编码 */ @ExcelProperty(value = "字典编码") - private Long dictCode; + private Long id; /** * 字典排序 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictTypeVo.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictTypeVo.java index 279e5824..47d8e0ad 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictTypeVo.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/vo/SysDictTypeVo.java @@ -27,7 +27,7 @@ public class SysDictTypeVo implements Serializable { * 字典主键 */ @ExcelProperty(value = "字典主键") - private Long dictId; + private Long id; /** * 字典名称 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysDeptMapper.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysDeptMapper.java deleted file mode 100644 index 5e2f5bd7..00000000 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysDeptMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package cc.iotkit.system.mapper; - -import cc.iotkit.model.system.SysDept; -import cc.iotkit.system.dto.vo.SysDeptVo; - -import java.util.List; - -/** - * 部门管理 数据层 - * - * @author Lion Li - */ -public interface SysDeptMapper extends BaseMapperPlus { - - /** - * 查询部门管理数据 - * - * @param queryWrapper 查询条件 - * @return 部门信息集合 - */ - @DataPermission({ - @DataColumn(key = "deptName", value = "dept_id") - }) - List selectDeptList(@Param(Constants.WRAPPER) Wrapper queryWrapper); - - @DataPermission({ - @DataColumn(key = "deptName", value = "dept_id") - }) - SysDeptVo selectDeptById(Long deptId); - - /** - * 根据角色ID查询部门树信息 - * - * @param roleId 角色ID - * @param deptCheckStrictly 部门树选择项是否关联显示 - * @return 选中部门列表 - */ - List selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); - -} diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysDictDataMapper.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysDictDataMapper.java deleted file mode 100644 index 52f7779d..00000000 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysDictDataMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package cc.iotkit.system.mapper; - -import cc.iotkit.common.constant.UserConstants; -import cc.iotkit.model.system.SysDictData; -import cc.iotkit.system.dto.vo.SysDictDataVo; - -import java.util.List; - -/** - * 字典表 数据层 - * - * @author Lion Li - */ -public interface SysDictDataMapper extends BaseMapperPlus { - - default List selectDictDataByType(String dictType) { - return selectVoList( - new LambdaQueryWrapper() - .eq(SysDictData::getStatus, UserConstants.DICT_NORMAL) - .eq(SysDictData::getDictType, dictType) - .orderByAsc(SysDictData::getDictSort)); - } -} diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysPostMapper.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysPostMapper.java deleted file mode 100644 index 066a963e..00000000 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/mapper/SysPostMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package cc.iotkit.system.mapper; - -import cc.iotkit.system.dto.vo.SysPostVo; - -import java.util.List; - -/** - * 岗位信息 数据层 - * - * @author Lion Li - */ -public interface SysPostMapper extends BaseMapperPlus { - - /** - * 根据用户ID获取岗位选择框列表 - * - * @param userId 用户ID - * @return 选中岗位ID列表 - */ - List selectPostListByUserId(Long userId); - - /** - * 查询用户所属岗位组 - * - * @param userName 用户名 - * @return 结果 - */ - List selectPostsByUserName(String userName); - -} diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysLogininforService.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysLogininforService.java index ed823ae0..01e3ca96 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysLogininforService.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysLogininforService.java @@ -38,7 +38,7 @@ public interface ISysLogininforService { * @param infoIds 需要删除的登录日志ID * @return 结果 */ - int deleteLogininforByIds(Long[] infoIds); + void deleteLogininforByIds(Long[] infoIds); /** * 清空系统登录日志 diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysOssService.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysOssService.java index 6ff7f43e..2c318789 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysOssService.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/ISysOssService.java @@ -4,9 +4,9 @@ import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging; import cc.iotkit.system.dto.bo.SysOssBo; import cc.iotkit.system.dto.vo.SysOssVo; -import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Collection; import java.util.List; diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDataScopeServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDataScopeServiceImpl.java index 0f187caf..b24a71ed 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDataScopeServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDataScopeServiceImpl.java @@ -1,11 +1,5 @@ package cc.iotkit.system.service.impl; -import cc.iotkit.common.utils.StreamUtils; -import cc.iotkit.model.system.SysDept; -import cc.iotkit.system.dto.SysRoleDept; -import cc.iotkit.system.mapper.SysDeptMapper; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.convert.Convert; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictDataServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictDataServiceImpl.java index fa2092fe..43c0e313 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictDataServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictDataServiceImpl.java @@ -4,13 +4,11 @@ import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging; import cc.iotkit.common.constant.CacheNames; -import cc.iotkit.common.exception.BizException; -import cc.iotkit.common.redis.utils.CacheUtils; import cc.iotkit.common.utils.MapstructUtils; +import cc.iotkit.data.system.ISysDictData; import cc.iotkit.model.system.SysDictData; import cc.iotkit.system.dto.bo.SysDictDataBo; import cc.iotkit.system.dto.vo.SysDictDataVo; -import cc.iotkit.system.mapper.SysDictDataMapper; import cc.iotkit.system.service.ISysDictDataService; import lombok.RequiredArgsConstructor; import org.springframework.cache.annotation.CachePut; @@ -27,13 +25,16 @@ import java.util.List; @Service public class SysDictDataServiceImpl implements ISysDictDataService { - private final SysDictDataMapper baseMapper; + private final ISysDictData sysDictData; @Override public Paging selectPageDictDataList(SysDictDataBo dictData, PageRequest query) { - LambdaQueryWrapper lqw = buildQueryWrapper(dictData); - Page page = baseMapper.selectVoPage(query.build(), lqw); - return TableDataInfo.build(page); + return MapstructUtils.convert( + sysDictData.findByConditions( + MapstructUtils.convert(dictData, SysDictData.class), + query.getPageNum(), + query.getPageSize() + ), SysDictDataVo.class); } /** @@ -44,18 +45,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService { */ @Override public List selectDictDataList(SysDictDataBo dictData) { - LambdaQueryWrapper lqw = buildQueryWrapper(dictData); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(SysDictDataBo bo) { - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort()); - lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel()); - lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictData::getStatus, bo.getStatus()); - lqw.orderByAsc(SysDictData::getDictSort); - return lqw; + return MapstructUtils.convert( + sysDictData.findByConditions( + MapstructUtils.convert(dictData, SysDictData.class) + ), SysDictDataVo.class); } /** @@ -67,11 +60,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService { */ @Override public String selectDictLabel(String dictType, String dictValue) { - return baseMapper.selectOne(new LambdaQueryWrapper() - .select(SysDictData::getDictLabel) - .eq(SysDictData::getDictType, dictType) - .eq(SysDictData::getDictValue, dictValue)) - .getDictLabel(); + return sysDictData.findByDictTypeAndDictValue(dictType, dictValue).getDictLabel(); } /** @@ -82,7 +71,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService { */ @Override public SysDictDataVo selectDictDataById(Long dictCode) { - return baseMapper.selectVoById(dictCode); + return MapstructUtils.convert(sysDictData.findById(dictCode), SysDictDataVo.class); } /** @@ -93,9 +82,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService { @Override public void deleteDictDataByIds(Long[] dictCodes) { for (Long dictCode : dictCodes) { - SysDictData data = baseMapper.selectById(dictCode); - baseMapper.deleteById(dictCode); - CacheUtils.evict(CacheNames.SYS_DICT, data.getDictType()); + SysDictData data = sysDictData.findById(dictCode); + sysDictData.deleteById(dictCode); +// CacheUtils.evict(CacheNames.SYS_DICT, data.getDictType()); } } @@ -109,11 +98,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService { @Override public List insertDictData(SysDictDataBo bo) { SysDictData data = MapstructUtils.convert(bo, SysDictData.class); - int row = baseMapper.insert(data); - if (row > 0) { - return baseMapper.selectDictDataByType(data.getDictType()); - } - throw new BizException("操作失败"); + sysDictData.save(data); + return MapstructUtils.convert(sysDictData.findByDicType(data.getDictType()), SysDictDataVo.class); } /** @@ -122,15 +108,12 @@ public class SysDictDataServiceImpl implements ISysDictDataService { * @param bo 字典数据信息 * @return 结果 */ - @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") +// @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") @Override public List updateDictData(SysDictDataBo bo) { SysDictData data = MapstructUtils.convert(bo, SysDictData.class); - int row = baseMapper.updateById(data); - if (row > 0) { - return baseMapper.selectDictDataByType(data.getDictType()); - } - throw new BizException("操作失败"); + sysDictData.save(data); + return MapstructUtils.convert(sysDictData.findByDicType(data.getDictType()), SysDictDataVo.class); } } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java index e3e18fbe..ef2cda26 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java @@ -1,9 +1,9 @@ package cc.iotkit.system.service.impl; import cc.iotkit.common.api.PageRequest; +import cc.iotkit.common.api.Paging; import cc.iotkit.common.constant.CacheConstants; import cc.iotkit.common.constant.CacheNames; -import cc.iotkit.common.api.Paging; import cc.iotkit.common.exception.BizException; import cc.iotkit.common.redis.utils.CacheUtils; import cc.iotkit.common.service.DictService; @@ -11,21 +11,17 @@ import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.SpringUtils; import cc.iotkit.common.utils.StreamUtils; import cc.iotkit.common.utils.StringUtils; -import cc.iotkit.model.system.SysDictData; +import cc.iotkit.data.system.ISysDictData; +import cc.iotkit.data.system.ISysDictTypeData; import cc.iotkit.model.system.SysDictType; import cc.iotkit.system.dto.bo.SysDictTypeBo; import cc.iotkit.system.dto.vo.SysDictDataVo; import cc.iotkit.system.dto.vo.SysDictTypeVo; -import cc.iotkit.system.mapper.SysDictDataMapper; -import cn.dev33.satoken.context.SaHolder; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjectUtil; import cc.iotkit.system.service.ISysDictTypeService; +import cn.dev33.satoken.context.SaHolder; +import cn.hutool.core.util.ObjectUtil; import lombok.RequiredArgsConstructor; -import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; @@ -42,14 +38,16 @@ import java.util.stream.Collectors; @Service public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService { - private final SysDictTypeMapper baseMapper; - private final SysDictDataMapper dictDataMapper; + private final ISysDictTypeData sysDictTypeData; + private final ISysDictData sysDictData; @Override - public Paging selectPageDictTypeList(SysDictTypeBo dictType, PageRequest pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(dictType); - Page page = baseMapper.selectVoPage(query.build(), lqw); - return TableDataInfo.build(page); + public Paging selectPageDictTypeList(SysDictTypeBo dictType, PageRequest query) { + return MapstructUtils.convert( + sysDictTypeData.findByConditions( + MapstructUtils.convert(dictType, SysDictType.class), + query.getPageNum(), query.getPageSize()), + SysDictTypeVo.class); } /** @@ -60,19 +58,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService */ @Override public List selectDictTypeList(SysDictTypeBo dictType) { - LambdaQueryWrapper lqw = buildQueryWrapper(dictType); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(SysDictTypeBo bo) { - Map params = bo.getParams(); - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.like(StringUtils.isNotBlank(bo.getDictName()), SysDictType::getDictName, bo.getDictName()); - lqw.like(StringUtils.isNotBlank(bo.getDictType()), SysDictType::getDictType, bo.getDictType()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictType::getStatus, bo.getStatus()); - lqw.between(params.get("beginTime") != null && params.get("endTime") != null, - SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); - return lqw; + return MapstructUtils.convert( + sysDictTypeData.findByConditions( + MapstructUtils.convert(dictType, SysDictType.class)), + SysDictTypeVo.class); } /** @@ -82,7 +71,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService */ @Override public List selectDictTypeAll() { - return baseMapper.selectVoList(); + return MapstructUtils.convert(sysDictTypeData.findAll(), SysDictTypeVo.class); } /** @@ -91,14 +80,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService * @param dictType 字典类型 * @return 字典数据集合信息 */ - @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") +// @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") @Override public List selectDictDataByType(String dictType) { - List dictDatas = dictDataMapper.selectDictDataByType(dictType); - if (CollUtil.isNotEmpty(dictDatas)) { - return dictDatas; - } - return null; + return MapstructUtils.convert(sysDictData.findByDicType(dictType), SysDictDataVo.class); } /** @@ -109,7 +94,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService */ @Override public SysDictTypeVo selectDictTypeById(Long dictId) { - return baseMapper.selectVoById(dictId); + return MapstructUtils.convert(sysDictTypeData.findById(dictId), SysDictTypeVo.class); } /** @@ -118,10 +103,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService * @param dictType 字典类型 * @return 字典类型 */ - @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") +// @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") @Override public SysDictTypeVo selectDictTypeByType(String dictType) { - return baseMapper.selectVoById(new LambdaQueryWrapper().eq(SysDictType::getDictType, dictType)); + return MapstructUtils.convert(sysDictTypeData.findByDicType(dictType), SysDictTypeVo.class); } /** @@ -132,14 +117,13 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService @Override public void deleteDictTypeByIds(Long[] dictIds) { for (Long dictId : dictIds) { - SysDictType dictType = baseMapper.selectById(dictId); - if (dictDataMapper.exists(new LambdaQueryWrapper() - .eq(SysDictData::getDictType, dictType.getDictType()))) { - throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); + SysDictType dictType = sysDictTypeData.findById(dictId); + if (sysDictData.countByDicType(dictType.getDictType()) > 0) { + throw new BizException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } CacheUtils.evict(CacheNames.SYS_DICT, dictType.getDictType()); } - baseMapper.deleteBatchIds(Arrays.asList(dictIds)); + sysDictTypeData.deleteByIds(dictIds); } /** @@ -156,15 +140,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService * @param bo 字典类型信息 * @return 结果 */ - @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") +// @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") @Override public List insertDictType(SysDictTypeBo bo) { SysDictType dict = MapstructUtils.convert(bo, SysDictType.class); - int row = baseMapper.insert(dict); - if (row > 0) { - return new ArrayList<>(); - } - throw new BizException("操作失败"); + sysDictTypeData.save(dict); + return new ArrayList<>(); } /** @@ -173,21 +154,13 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService * @param bo 字典类型信息 * @return 结果 */ - @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") +// @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") @Override - @Transactional(rollbackFor = Exception.class) public List updateDictType(SysDictTypeBo bo) { - SysDictType dict = MapstructUtils.convert(bo, SysDictType.class); - SysDictType oldDict = baseMapper.selectById(dict.getDictId()); - dictDataMapper.update(null, new LambdaUpdateWrapper() - .set(SysDictData::getDictType, dict.getDictType()) - .eq(SysDictData::getDictType, oldDict.getDictType())); - int row = baseMapper.updateById(dict); - if (row > 0) { - CacheUtils.evict(CacheNames.SYS_DICT, oldDict.getDictType()); - return dictDataMapper.selectDictDataByType(dict.getDictType()); - } - throw new BizException("操作失败"); + SysDictType oldDict = sysDictTypeData.findById(bo.getId()); + sysDictTypeData.updateDicType(oldDict.getDictType(), bo.getDictType()); +// CacheUtils.evict(CacheNames.SYS_DICT, oldDict.getDictType()); + return MapstructUtils.convert(sysDictData.findByDicType(bo.getDictType()), SysDictDataVo.class); } /** @@ -198,10 +171,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService */ @Override public boolean checkDictTypeUnique(SysDictTypeBo dictType) { - boolean exist = baseMapper.exists(new LambdaQueryWrapper() - .eq(SysDictType::getDictType, dictType.getDictType()) - .ne(ObjectUtil.isNotNull(dictType.getDictId()), SysDictType::getDictId, dictType.getDictId())); - return !exist; +// boolean exist = baseMapper.exists(new LambdaQueryWrapper() +// .eq(SysDictType::getDictType, dictType.getDictType()) +// .ne(ObjectUtil.isNotNull(dictType.getDictId()), SysDictType::getDictId, dictType.getDictId())); +// return !exist; + return false; } /** @@ -225,8 +199,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService Map map = StreamUtils.toMap(datas, SysDictDataVo::getDictValue, SysDictDataVo::getDictLabel); if (StringUtils.containsAny(dictValue, separator)) { return Arrays.stream(dictValue.split(separator)) - .map(v -> map.getOrDefault(v, StringUtils.EMPTY)) - .collect(Collectors.joining(separator)); + .map(v -> map.getOrDefault(v, StringUtils.EMPTY)) + .collect(Collectors.joining(separator)); } else { return map.getOrDefault(dictValue, StringUtils.EMPTY); } @@ -253,8 +227,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService Map map = StreamUtils.toMap(datas, SysDictDataVo::getDictLabel, SysDictDataVo::getDictValue); if (StringUtils.containsAny(dictLabel, separator)) { return Arrays.stream(dictLabel.split(separator)) - .map(l -> map.getOrDefault(l, StringUtils.EMPTY)) - .collect(Collectors.joining(separator)); + .map(l -> map.getOrDefault(l, StringUtils.EMPTY)) + .collect(Collectors.joining(separator)); } else { return map.getOrDefault(dictLabel, StringUtils.EMPTY); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java index 39379811..9043cd3e 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java @@ -1,31 +1,26 @@ package cc.iotkit.system.service.impl; import cc.iotkit.common.api.PageRequest; -import cc.iotkit.common.constant.Constants; import cc.iotkit.common.api.Paging; +import cc.iotkit.common.constant.Constants; import cc.iotkit.common.log.event.LogininforEvent; import cc.iotkit.common.utils.MapstructUtils; -import cc.iotkit.common.utils.ServletUtils; import cc.iotkit.common.utils.StringUtils; import cc.iotkit.common.utils.ip.AddressUtils; -import cc.iotkit.common.web.utils.UnsignedMathGenerator; +import cc.iotkit.data.system.ISysLogininforData; import cc.iotkit.model.system.SysLogininfor; import cc.iotkit.system.dto.bo.SysLogininforBo; import cc.iotkit.system.dto.vo.SysLogininforVo; -import cn.hutool.http.useragent.UserAgent; -import cn.hutool.http.useragent.UserAgentUtil; import cc.iotkit.system.service.ISysLogininforService; +import cn.hutool.http.useragent.UserAgent; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; -import jakarta.servlet.http.HttpServletRequest; -import java.util.Arrays; import java.util.Date; import java.util.List; -import java.util.Map; /** * 系统访问日志情况信息 服务层处理 @@ -37,7 +32,7 @@ import java.util.Map; @Service public class SysLogininforServiceImpl implements ISysLogininforService { - private final SysLogininforMapper baseMapper; + private final ISysLogininforData sysLogininforData; /** * 记录登录信息 @@ -47,10 +42,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService { @Async @EventListener public void recordLogininfor(LogininforEvent logininforEvent) { - HttpServletRequest request = logininforEvent.getRequest(); - final UserAgent userAgent = UserAgentUtil.parse(request.getHeader("User-Agent")); - final String ip = UnsignedMathGenerator.ServletUtils.getClientIP(request); - + String ip = logininforEvent.getIp(); String address = AddressUtils.getRealAddressByIP(ip); StringBuilder s = new StringBuilder(); s.append(getBlock(ip)); @@ -60,6 +52,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService { s.append(getBlock(logininforEvent.getMessage())); // 打印信息到日志 log.info(s.toString(), logininforEvent.getArgs()); + UserAgent userAgent = logininforEvent.getUserAgent(); // 获取客户端操作系统 String os = userAgent.getOs().getName(); // 获取客户端浏览器 @@ -92,19 +85,13 @@ public class SysLogininforServiceImpl implements ISysLogininforService { @Override public Paging selectPageLogininforList(SysLogininforBo logininfor, PageRequest query) { - Map params = logininfor.getParams(); - LambdaQueryWrapper lqw = new LambdaQueryWrapper() - .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) - .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) - .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) - .between(params.get("beginTime") != null && params.get("endTime") != null, - SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")); - if (StringUtils.isBlank(query.getOrderByColumn())) { - pageQuery.setOrderByColumn("info_id"); - pageQuery.setIsAsc("desc"); - } - Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(page); + return MapstructUtils.convert( + sysLogininforData.findByConditions( + MapstructUtils.convert(logininfor, SysLogininfor.class), + query.getPageNum(), + query.getPageSize() + ), SysLogininforVo.class + ); } /** @@ -116,7 +103,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService { public void insertLogininfor(SysLogininforBo bo) { SysLogininfor logininfor = MapstructUtils.convert(bo, SysLogininfor.class); logininfor.setLoginTime(new Date()); - baseMapper.insert(logininfor); + sysLogininforData.save(logininfor); } /** @@ -127,14 +114,11 @@ public class SysLogininforServiceImpl implements ISysLogininforService { */ @Override public List selectLogininforList(SysLogininforBo logininfor) { - Map params = logininfor.getParams(); - return baseMapper.selectVoList(new LambdaQueryWrapper() - .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) - .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) - .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) - .between(params.get("beginTime") != null && params.get("endTime") != null, - SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")) - .orderByDesc(SysLogininfor::getInfoId)); + return MapstructUtils.convert( + sysLogininforData.findByConditions( + MapstructUtils.convert(logininfor, SysLogininfor.class) + ), SysLogininforVo.class + ); } /** @@ -144,8 +128,8 @@ public class SysLogininforServiceImpl implements ISysLogininforService { * @return 结果 */ @Override - public int deleteLogininforByIds(Long[] infoIds) { - return baseMapper.deleteBatchIds(Arrays.asList(infoIds)); + public void deleteLogininforByIds(Long[] infoIds) { + sysLogininforData.deleteByIds(infoIds); } /** @@ -153,6 +137,6 @@ public class SysLogininforServiceImpl implements ISysLogininforService { */ @Override public void cleanLogininfor() { - baseMapper.delete(new LambdaQueryWrapper<>()); + sysLogininforData.deleteAll(); } } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysMenuServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysMenuServiceImpl.java index c57c457d..d4e25447 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysMenuServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysMenuServiceImpl.java @@ -33,11 +33,6 @@ import java.util.*; @Service public class SysMenuServiceImpl implements ISysMenuService { - private final SysMenuMapper baseMapper; - private final SysRoleMapper roleMapper; - private final SysRoleMenuMapper roleMenuMapper; - private final SysTenantPackageMapper tenantPackageMapper; - /** * 根据用户查询系统菜单列表 * diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysNoticeServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysNoticeServiceImpl.java index 114341e2..7feff76d 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysNoticeServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysNoticeServiceImpl.java @@ -25,9 +25,6 @@ import java.util.List; @Service public class SysNoticeServiceImpl implements ISysNoticeService { - private final SysNoticeMapper baseMapper; - private final SysUserMapper userMapper; - @Override public Paging selectPageNoticeList(SysNoticeBo notice, PageRequest query) { LambdaQueryWrapper lqw = buildQueryWrapper(notice); diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java index 376143ca..8a39ac0a 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java @@ -36,11 +36,6 @@ import java.util.*; @Service public class SysRoleServiceImpl implements ISysRoleService { - private final SysRoleMapper baseMapper; - private final SysRoleMenuMapper roleMenuMapper; - private final SysUserRoleMapper userRoleMapper; - private final SysRoleDeptMapper roleDeptMapper; - @Override public Paging selectPageRoleList(SysRoleBo role, PageRequest query) { Page page = baseMapper.selectPageRoleList(query.build(), this.buildQueryWrapper(role));