档案管理2
This commit is contained in:
parent
629f85d8fd
commit
7bdc6a79d7
@ -51,4 +51,6 @@ public class BaseConstants {
|
||||
public static final String PROPERTY_INTERIM_PERIOD = "property_interim_period";
|
||||
/** 资产过期通知模板 */
|
||||
public static final String PROPERTY_EXPIRED = "property_expired";
|
||||
/** 档案分类字典 */
|
||||
public static final String ARCHIVES_TYPE = "archives_type";
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.archives.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 档案表 控制层
|
||||
* @author 小李
|
||||
* @date 20:15 2024/8/28
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/archives")
|
||||
@Validated
|
||||
public class ArchivesController {
|
||||
|
||||
@Resource
|
||||
private ArchivesService archivesService;
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.archives.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.archives.service.ArchivesRoleService;
|
||||
import cn.iocoder.yudao.module.archives.vo.ArchivesRoleReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 档案权限表 控制层
|
||||
* @author 小李
|
||||
* @date 8:58 2024/8/28
|
||||
**/
|
||||
@RestController
|
||||
@Tag(name = "企业管理 - 档案管理")
|
||||
@RequestMapping("/archives/role")
|
||||
@Validated
|
||||
public class ArchivesRoleController {
|
||||
|
||||
@Resource
|
||||
private ArchivesRoleService archivesRoleService;
|
||||
|
||||
/**
|
||||
* 新增和修改档案权限和档案名称
|
||||
* @author 小李
|
||||
* @date 9:26 2024/8/28
|
||||
**/
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "新增/修改企业管理-档案名称和权限")
|
||||
@PreAuthorize("@ss.hasPermission('archives:catalog:create')")
|
||||
public CommonResult updateArchivesRoleAndDict(@RequestBody ArchivesRoleReqVO archivesRoleReqVO){
|
||||
archivesRoleService.updateArchivesRoleAndDict(archivesRoleReqVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业管理-档案名称和权限
|
||||
* @author 小李
|
||||
* @date 10:34 2024/8/28
|
||||
* @param ids
|
||||
**/
|
||||
@DeleteMapping("/remove/{ids}")
|
||||
@Operation(summary = "删除企业管理-档案名称和权限")
|
||||
@PreAuthorize("@ss.hasPermission('archives:catalog:remove')")
|
||||
public CommonResult removeArchivesRoleAndDict(@PathVariable Long[] ids){
|
||||
archivesRoleService.removeArchivesRoleAndDict(ids);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看档案管理名称 通过当前登录用户的角色去筛选
|
||||
* @author 小李
|
||||
* @date 11:06 2024/8/28
|
||||
* @param dictType 字典类型
|
||||
**/
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查看企业管理-档案名称")
|
||||
public CommonResult listArchivesRoleAndDict(@RequestParam("dictType") String dictType){
|
||||
return success(archivesRoleService.listArchivesRoleAndDict(dictType));
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.archives.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 档案表
|
||||
* @author 小李
|
||||
* @date 20:08 2024/8/28
|
||||
**/
|
||||
@TableName(value ="company_archives")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Archives extends TenantBaseDO {
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* system_dict_data的id(标识这个档案属于那个档案目录)
|
||||
*/
|
||||
private Long dataId;
|
||||
|
||||
/**
|
||||
* 档案名称
|
||||
*/
|
||||
private String archivesName;
|
||||
|
||||
/**
|
||||
* 档案类别(字典archives_item_type)
|
||||
*/
|
||||
private String archivesType;
|
||||
|
||||
/**
|
||||
* 档案的物理存放位置
|
||||
*/
|
||||
private String archivesPhysicsUrl;
|
||||
|
||||
/**
|
||||
* 档案的虚拟存放位置(infra_file的url,逗号分隔)
|
||||
*/
|
||||
private String archivesUrls;
|
||||
|
||||
/**
|
||||
* 档案唯一编码
|
||||
*/
|
||||
private String archivesCode;
|
||||
|
||||
/**
|
||||
* 合同签订时间(只有是合同类才有)
|
||||
*/
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 合同到期时间(只有是合同类才有)
|
||||
*/
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date expireTime;
|
||||
|
||||
/**
|
||||
* 部门id(system_dept表中的id)
|
||||
*/
|
||||
private Long deptId;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.archives.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 档案权限表
|
||||
* @author 小李
|
||||
* @date 8:50 2024/8/28
|
||||
**/
|
||||
@TableName(value ="company_archives_role")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ArchivesRole extends TenantBaseDO {
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 字典类型(system_dict_type的dict_type)
|
||||
*/
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 字典值ID(system_dict_data的id)
|
||||
*/
|
||||
private Long dataId;
|
||||
|
||||
/**
|
||||
* 角色ID(system_role的ID,用于分辨用户是否有权限查看)
|
||||
*/
|
||||
private String queryRoleIds;
|
||||
|
||||
/**
|
||||
* 角色ID(system_role的ID,用于分辨用户是否有权限修改)
|
||||
*/
|
||||
private String updateRoleIds;
|
||||
|
||||
/**
|
||||
* 角色ID(system_role的ID,用于分辨用户是否有权限新增)
|
||||
*/
|
||||
private String createRoleIds;
|
||||
|
||||
/**
|
||||
* 角色ID(system_role的ID,用于分辨用户是否有权限删除)
|
||||
*/
|
||||
private String deleteRoleIds;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
/** 字典值 档案名称 */
|
||||
@TableField(exist = false)
|
||||
private String dictLabel;
|
||||
|
||||
/** 用户是否可以新增档案 */
|
||||
@TableField(exist = false)
|
||||
private Boolean isCreated;
|
||||
|
||||
/** 用户是否可以修改档案 */
|
||||
@TableField(exist = false)
|
||||
private Boolean isUpdated;
|
||||
|
||||
/** 用户是否可以删除档案 */
|
||||
@TableField(exist = false)
|
||||
private Boolean isDeleted;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.archives.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 针对表【company_archives(档案表)】的数据库操作Mapper
|
||||
* @author 小李
|
||||
* @date 20:11 2024/8/28
|
||||
**/
|
||||
@Mapper
|
||||
public interface ArchivesMapper extends BaseMapper<Archives> {
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.archives.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.ArchivesRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 针对表【t_archives_role(档案权限表)】的数据库操作Mapper
|
||||
* @author 小李
|
||||
* @date 8:53 2024/8/28
|
||||
**/
|
||||
@Mapper
|
||||
public interface ArchivesRoleMapper extends BaseMapper<ArchivesRole> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.archives.service;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.ArchivesRole;
|
||||
import cn.iocoder.yudao.module.archives.vo.ArchivesRoleReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档案权限表 服务
|
||||
* @author 小李
|
||||
* @date 8:58 2024/8/28
|
||||
**/
|
||||
public interface ArchivesRoleService extends IService<ArchivesRole> {
|
||||
|
||||
/**
|
||||
* 新增和修改档案权限和档案名称
|
||||
* @author 小李
|
||||
* @date 9:26 2024/8/28
|
||||
**/
|
||||
void updateArchivesRoleAndDict(ArchivesRoleReqVO archivesRoleReqVO);
|
||||
|
||||
/**
|
||||
* 删除企业管理-档案名称和权限
|
||||
* @author 小李
|
||||
* @date 10:34 2024/8/28
|
||||
* @param ids
|
||||
**/
|
||||
void removeArchivesRoleAndDict(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查看档案管理名称 通过当前登录用户的角色去筛选
|
||||
* @author 小李
|
||||
* @date 11:06 2024/8/28
|
||||
* @param dictType 字典类型
|
||||
**/
|
||||
List<ArchivesRole> listArchivesRoleAndDict(String dictType);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.archives.service;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 档案表 服务
|
||||
* @author 小李
|
||||
* @date 20:13 2024/8/28
|
||||
**/
|
||||
public interface ArchivesService extends IService<Archives> {
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
package cn.iocoder.yudao.module.archives.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.BaseConstants;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||
import cn.iocoder.yudao.module.archives.entity.ArchivesRole;
|
||||
import cn.iocoder.yudao.module.archives.mapper.ArchivesRoleMapper;
|
||||
import cn.iocoder.yudao.module.archives.service.ArchivesRoleService;
|
||||
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
||||
import cn.iocoder.yudao.module.archives.vo.ArchivesRoleReqVO;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tencentcloudapi.tci.v20190318.models.Face;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
|
||||
/**
|
||||
* 档案权限表 服务实现类
|
||||
* 因为档案名称采用的是字典,所以这里提供操作权限的接口,字典的CRUD在这里完成
|
||||
*
|
||||
* @author 小李
|
||||
* @date 8:58 2024/8/28
|
||||
**/
|
||||
@Service
|
||||
public class ArchivesRoleServiceImpl extends ServiceImpl<ArchivesRoleMapper, ArchivesRole> implements ArchivesRoleService {
|
||||
|
||||
@Resource
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
@Resource
|
||||
private PermissionApi permissionApi;
|
||||
|
||||
@Resource
|
||||
private ArchivesService archivesService;
|
||||
|
||||
/**
|
||||
* 新增和修改档案权限和档案名称
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:26 2024/8/28
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void updateArchivesRoleAndDict(ArchivesRoleReqVO archivesRoleReqVO) {
|
||||
// 新增或修改字典值
|
||||
if (ObjectUtil.isNotEmpty(archivesRoleReqVO.getDataId())) {
|
||||
DictDataRespDTO dictDataRespDTO = new DictDataRespDTO();
|
||||
dictDataRespDTO.setId(archivesRoleReqVO.getDataId());
|
||||
dictDataRespDTO.setLabel(archivesRoleReqVO.getDictLabel());
|
||||
dictDataApi.updateDictData(dictDataRespDTO);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(archivesRoleReqVO.getDataId())) {
|
||||
dictDataApi.addDictData(archivesRoleReqVO.getDictType(), archivesRoleReqVO.getDictLabel(), archivesRoleReqVO.getDictLabel(), 0);
|
||||
DictDataRespDTO dictData = dictDataApi.getDictData(archivesRoleReqVO.getDictType(), archivesRoleReqVO.getDictLabel());
|
||||
archivesRoleReqVO.setDataId(dictData.getId());
|
||||
}
|
||||
// 新增或修改对应权限
|
||||
ArchivesRole archivesRole = baseMapper.selectOne(new LambdaQueryWrapper<ArchivesRole>().eq(ArchivesRole::getDataId, archivesRoleReqVO.getDataId()));
|
||||
if (ObjectUtil.isNotEmpty(archivesRole)) {
|
||||
baseMapper.update(archivesRoleReqVO, new LambdaQueryWrapper<ArchivesRole>().eq(ArchivesRole::getDataId, archivesRole.getDataId()));
|
||||
}
|
||||
if (ObjectUtil.isEmpty(archivesRole)) {
|
||||
baseMapper.insert(archivesRoleReqVO);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业管理-档案名称和权限
|
||||
*
|
||||
* @param ids
|
||||
* @author 小李
|
||||
* @date 10:34 2024/8/28
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void removeArchivesRoleAndDict(Long[] ids) {
|
||||
// 删除时需要判断删除的档案名称下有没有档案,有就不能删除
|
||||
Boolean flag = true;
|
||||
for (Long id : ids) {
|
||||
long count = archivesService.count(new LambdaQueryWrapper<Archives>().eq(Archives::getDataId, id));
|
||||
if (count != 0){
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag){
|
||||
throw exception0(500, "删除档案中还有子档案,不可删除");
|
||||
}
|
||||
dictDataApi.deleteDictDataByIds(ids);
|
||||
baseMapper.delete(new LambdaQueryWrapper<ArchivesRole>().in(ArchivesRole::getDataId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看档案管理名称 通过当前登录用户的角色去筛选
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @author 小李
|
||||
* @date 11:06 2024/8/28
|
||||
**/
|
||||
@Override
|
||||
public List<ArchivesRole> listArchivesRoleAndDict(String dictType) {
|
||||
// 当前登录用户的角色信息
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
List<Long> roleIds = permissionApi.getRoleIdsByUserId(loginUserId);
|
||||
|
||||
// 先判断查看这个是否存在
|
||||
Boolean exist = dictDataApi.exist(dictType);
|
||||
// 如果不存在就先创建
|
||||
if (!exist){
|
||||
List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList(BaseConstants.ARCHIVES_TYPE);
|
||||
DictDataRespDTO dataRespDTO = dictDataList.stream().filter(item -> item.getValue().equals(dictType)).collect(Collectors.toList()).get(0);
|
||||
dictDataApi.createDictType(dataRespDTO.getLabel(), dataRespDTO.getValue());
|
||||
}
|
||||
|
||||
// 获取当前用户有查看权限的档案名称,根据dictType去查,减少数据量
|
||||
List<ArchivesRole> archivesRoles = baseMapper.selectList(new LambdaQueryWrapper<ArchivesRole>().eq(ArchivesRole::getDictType, dictType));
|
||||
List<ArchivesRole> isQuery = archivesRoles.stream().filter(item -> {
|
||||
if (ObjectUtil.isEmpty(item.getQueryRoleIds())) {
|
||||
return false;
|
||||
}
|
||||
List<Long> dataRoles = Arrays.asList(item.getQueryRoleIds().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
Collection<Long> flag = CollUtil.intersection(dataRoles, roleIds);
|
||||
return CollectionUtil.isNotEmpty(flag);
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 判断当前用户对有查看权限的档案名称中内容的增、删、改权限
|
||||
isQuery.stream().forEach(item -> {
|
||||
// 增加权限
|
||||
item.setIsCreated(checkPermission(item.getCreateRoleIds(), roleIds));
|
||||
// 删除权限
|
||||
item.setIsDeleted(checkPermission(item.getDeleteRoleIds(), roleIds));
|
||||
// 修改权限
|
||||
item.setIsUpdated(checkPermission(item.getUpdateRoleIds(), roleIds));
|
||||
});
|
||||
|
||||
// dictLabel赋值
|
||||
List<Long> dataIds = isQuery.stream().map(item -> item.getDataId()).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(dataIds)) {
|
||||
List<DictDataRespDTO> dictDataListById = dictDataApi.getDictDataListById(dataIds);
|
||||
Map<Long, String> map = dictDataListById.stream().collect(Collectors.toMap(DictDataRespDTO::getId, DictDataRespDTO::getLabel));
|
||||
List<ArchivesRole> result = isQuery.stream().peek(item -> item.setDictLabel(map.get(item.getDataId()))).collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
return isQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否有对应功能的权限
|
||||
*
|
||||
* @param dataRoleIds 功能角色IDs
|
||||
* @param userRoleIds 用户角色IDs
|
||||
* @author 小李
|
||||
* @date 12:07 2024/8/28
|
||||
**/
|
||||
private Boolean checkPermission(String dataRoleIds, List<Long> userRoleIds) {
|
||||
if (ObjectUtil.isEmpty(dataRoleIds)) {
|
||||
return false;
|
||||
}
|
||||
List<Long> tempRoleIds = Arrays.asList(dataRoleIds.split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
Collection<Long> flag = CollUtil.intersection(tempRoleIds, userRoleIds);
|
||||
return CollectionUtil.isNotEmpty(flag);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.archives.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||
import cn.iocoder.yudao.module.archives.mapper.ArchivesMapper;
|
||||
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 档案表 服务实现类
|
||||
* @author 小李
|
||||
* @date 20:14 2024/8/28
|
||||
**/
|
||||
@Service
|
||||
public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> implements ArchivesService {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.archives.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 档案表 响应VO
|
||||
* @author 小李
|
||||
* @date 20:10 2024/8/28
|
||||
**/
|
||||
@Data
|
||||
public class ArchiveRespVO extends Archives {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.archives.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 档案表 请求VO
|
||||
* @author 小李
|
||||
* @date 20:09 2024/8/28
|
||||
**/
|
||||
@Data
|
||||
public class ArchivesReqVO extends Archives {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.archives.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.ArchivesRole;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 档案权限表 请求VO
|
||||
* @author 小李
|
||||
* @date 8:58 2024/8/28
|
||||
**/
|
||||
@Data
|
||||
public class ArchivesRoleReqVO extends ArchivesRole {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.archives.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.archives.entity.ArchivesRole;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 档案权限表 响应VO
|
||||
* @author 小李
|
||||
* @date 8:58 2024/8/28
|
||||
**/
|
||||
@Data
|
||||
public class ArchivesRoleRespVO extends ArchivesRole {
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?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="cn.iocoder.yudao.module.archives.mapper.ArchivesMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.archives.entity.Archives">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="dataId" column="data_id" jdbcType="BIGINT"/>
|
||||
<result property="archivesName" column="archives_name" jdbcType="VARCHAR"/>
|
||||
<result property="archivesType" column="archives_type" jdbcType="VARCHAR"/>
|
||||
<result property="archivesPhysicsUrl" column="archives_physics_url" jdbcType="VARCHAR"/>
|
||||
<result property="archivesUrls" column="archives_urls" jdbcType="VARCHAR"/>
|
||||
<result property="archivesCode" column="archives_code" jdbcType="VARCHAR"/>
|
||||
<result property="signTime" column="sign_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="expireTime" column="expire_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
id,data_id,archives_name,
|
||||
archives_type,archives_physics_url,archives_urls,
|
||||
archives_code,sign_time,expire_time,
|
||||
dept_id,tenant_id,deleted,
|
||||
creator,create_time,updater,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,23 @@
|
||||
<?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="cn.iocoder.yudao.module.archives.mapper.ArchivesRoleMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.archives.entity.ArchivesRole">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="dictType" column="dict_type" jdbcType="VARCHAR"/>
|
||||
<result property="dataId" column="data_id" jdbcType="BIGINT"/>
|
||||
<result property="queryRoleIds" column="query_role_ids" jdbcType="BIGINT"/>
|
||||
<result property="updateRoleIds" column="update_role_ids" jdbcType="BIGINT"/>
|
||||
<result property="createRoleIds" column="create_role_ids" jdbcType="BIGINT"/>
|
||||
<result property="deleteRoleIds" column="delete_role_ids" jdbcType="BIGINT"/>
|
||||
<result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
id,dict_type,data_id,
|
||||
query_role_ids,update_role_ids,add_role_ids,
|
||||
delete_role_ids,dept_id
|
||||
</sql>
|
||||
</mapper>
|
@ -33,7 +33,9 @@ import java.util.List;
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-04-11 10:25:58
|
||||
* 弃用 新实现在di-module-company
|
||||
*/
|
||||
@Deprecated
|
||||
@RestController
|
||||
@RequestMapping("/system/tArchives")
|
||||
public class TArchivesController {
|
||||
|
@ -15,7 +15,9 @@ import java.util.List;
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-04-11 10:25:58
|
||||
* 弃用 新实现在di-module-company
|
||||
*/
|
||||
@Deprecated
|
||||
@Mapper
|
||||
public interface TArchivesMapper extends BaseMapper<TArchives> {
|
||||
IPage<TArchives> selectTArchivesList(Page page, @Param("param") TArchivesRequest tArchives);
|
||||
|
@ -34,7 +34,9 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-04-11 10:25:58
|
||||
* 弃用 新实现在di-module-company
|
||||
*/
|
||||
@Deprecated
|
||||
@Service
|
||||
public class TArchivesService extends ServiceImpl<TArchivesMapper, TArchives> {
|
||||
|
||||
|
@ -95,4 +95,20 @@ public interface DictDataApi {
|
||||
void createDictType(String name,String type);
|
||||
void addDictData(String dictType,String label,String value, Integer sort);
|
||||
void deleteDictDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
* @author 小李
|
||||
* @date 9:48 2024/8/28
|
||||
* @param dictDataRespDTO 字典对象
|
||||
**/
|
||||
void updateDictData(DictDataRespDTO dictDataRespDTO);
|
||||
|
||||
/**
|
||||
* 获得包含查看id的字典数据
|
||||
* @author 小李
|
||||
* @date 15:38 2024/8/28
|
||||
* @param dataIds id集合
|
||||
**/
|
||||
List<DictDataRespDTO> getDictDataListById(List<Long> dataIds);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 字典数据 API 实现类
|
||||
@ -108,4 +109,27 @@ public class DictDataApiImpl implements DictDataApi {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
* @author 小李
|
||||
* @date 9:48 2024/8/28
|
||||
* @param dictDataRespDTO 字典对象
|
||||
**/
|
||||
@Override
|
||||
public void updateDictData(DictDataRespDTO dictDataRespDTO){
|
||||
dictDataService.updateDictData(dictDataRespDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得包含查看id的字典数据
|
||||
* @author 小李
|
||||
* @date 15:38 2024/8/28
|
||||
* @param dataIds id集合
|
||||
**/
|
||||
@Override
|
||||
public List<DictDataRespDTO> getDictDataListById(List<Long> dataIds){
|
||||
List<DictDataDO> dictDataListById = dictDataService.getDictDataListById(dataIds);
|
||||
return dictDataListById.stream().map(item -> BeanUtils.toBean(item, DictDataRespDTO.class)).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.service.dict;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||
@ -31,6 +32,13 @@ public interface DictDataService {
|
||||
*/
|
||||
void updateDictData(DictDataSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 更新字典数据
|
||||
* @author 小李
|
||||
* @param dataRespDTO 字典数据信息
|
||||
*/
|
||||
void updateDictData(DictDataRespDTO dataRespDTO);
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
*
|
||||
@ -107,4 +115,12 @@ public interface DictDataService {
|
||||
*/
|
||||
List<DictDataDO> getDictDataListByDictType(String dictType);
|
||||
|
||||
/**
|
||||
* 获得包含查看id的字典数据
|
||||
* @author 小李
|
||||
* @date 15:38 2024/8/28
|
||||
* @param dataIds id集合
|
||||
**/
|
||||
List<DictDataDO> getDictDataListById(List<Long> dataIds);
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||
@ -89,6 +91,19 @@ public class DictDataServiceImpl implements DictDataService {
|
||||
dictDataMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新字典数据
|
||||
* @author 小李
|
||||
* @param dataRespDTO 字典数据信息
|
||||
*/
|
||||
@Override
|
||||
public void updateDictData(DictDataRespDTO dataRespDTO){
|
||||
DictDataDO dictDataDO = new DictDataDO();
|
||||
dictDataDO.setId(dataRespDTO.getId());
|
||||
dictDataDO.setLabel(dataRespDTO.getLabel());
|
||||
dictDataMapper.updateById(dictDataDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDictData(Long id) {
|
||||
// 校验是否存在
|
||||
@ -176,4 +191,15 @@ public class DictDataServiceImpl implements DictDataService {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得包含查看id的字典数据
|
||||
* @author 小李
|
||||
* @date 15:38 2024/8/28
|
||||
* @param dataIds id集合
|
||||
**/
|
||||
@Override
|
||||
public List<DictDataDO> getDictDataListById(List<Long> dataIds){
|
||||
return dictDataMapper.selectList(new LambdaQueryWrapperX<DictDataDO>().in(DictDataDO::getId, dataIds));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user