1. 附件加密上传下载

2. 新增数据命名与简写标准管理菜单
This commit is contained in:
chenbowen
2025-07-22 19:36:46 +08:00
parent 8ab6cb4bae
commit af8f990cc8
11 changed files with 494 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.system.controller.admin.stdnms.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 数据命名与简写标准分页 Request VO")
@Data
public class StdNmsPageReqVO extends PageParam {
@Schema(description = "英文")
private String word;
@Schema(description = "简写")
private String abbr;
@Schema(description = "中文意思")
private String info;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.system.controller.admin.stdnms.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 数据命名与简写标准 Response VO")
@Data
@ExcelIgnoreUnannotated
public class StdNmsRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2987")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "英文", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("英文")
private String word;
@Schema(description = "简写", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("简写")
private String abbr;
@Schema(description = "中文意思", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("中文意思")
private String info;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.controller.admin.stdnms.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 数据命名与简写标准新增/修改 Request VO")
@Data
public class StdNmsSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2987")
private Long id;
@Schema(description = "英文", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "英文不能为空")
private String word;
@Schema(description = "简写", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "简写不能为空")
private String abbr;
@Schema(description = "中文意思", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "中文意思不能为空")
private String info;
}

View File

@@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.system.dal.dataobject.stdnms;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 数据命名与简写标准 DO
*
* @author 后台管理
*/
@TableName("system_std_nms")
@KeySequence("system_std_nms_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class StdNmsDO extends BaseDO {
/**
* 主键ID
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 英文
*/
private String word;
/**
* 简写
*/
private String abbr;
/**
* 中文意思
*/
private String info;
}

View File

@@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.system.dal.mysql.stdnms;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.stdnms.StdNmsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.stdnms.vo.*;
/**
* 数据命名与简写标准 Mapper
*
* @author 后台管理
*/
@Mapper
public interface StdNmsMapper extends BaseMapperX<StdNmsDO> {
default PageResult<StdNmsDO> selectPage(StdNmsPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<StdNmsDO>()
.eqIfPresent(StdNmsDO::getWord, reqVO.getWord())
.eqIfPresent(StdNmsDO::getAbbr, reqVO.getAbbr())
.eqIfPresent(StdNmsDO::getInfo, reqVO.getInfo())
.betweenIfPresent(StdNmsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(StdNmsDO::getId));
}
}

View File

@@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.system.service.stdnms;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.system.controller.admin.stdnms.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.stdnms.StdNmsDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 数据命名与简写标准 Service 接口
*
* @author 后台管理
*/
public interface StdNmsService {
/**
* 创建数据命名与简写标准
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createStdNms(@Valid StdNmsSaveReqVO createReqVO);
/**
* 更新数据命名与简写标准
*
* @param updateReqVO 更新信息
*/
void updateStdNms(@Valid StdNmsSaveReqVO updateReqVO);
/**
* 删除数据命名与简写标准
*
* @param id 编号
*/
void deleteStdNms(Long id);
/**
* 批量删除数据命名与简写标准
*
* @param ids 编号
*/
void deleteStdNmsListByIds(List<Long> ids);
/**
* 获得数据命名与简写标准
*
* @param id 编号
* @return 数据命名与简写标准
*/
StdNmsDO getStdNms(Long id);
/**
* 获得数据命名与简写标准分页
*
* @param pageReqVO 分页查询
* @return 数据命名与简写标准分页
*/
PageResult<StdNmsDO> getStdNmsPage(StdNmsPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,92 @@
package cn.iocoder.yudao.module.system.service.stdnms;
import cn.hutool.core.collection.CollUtil;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.stdnms.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.stdnms.StdNmsDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.dal.mysql.stdnms.StdNmsMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
* 数据命名与简写标准 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class StdNmsServiceImpl implements StdNmsService {
@Resource
private StdNmsMapper stdNmsMapper;
@Override
public Long createStdNms(StdNmsSaveReqVO createReqVO) {
// 插入
StdNmsDO stdNms = BeanUtils.toBean(createReqVO, StdNmsDO.class);
stdNmsMapper.insert(stdNms);
// 返回
return stdNms.getId();
}
@Override
public void updateStdNms(StdNmsSaveReqVO updateReqVO) {
// 校验存在
validateStdNmsExists(updateReqVO.getId());
// 更新
StdNmsDO updateObj = BeanUtils.toBean(updateReqVO, StdNmsDO.class);
stdNmsMapper.updateById(updateObj);
}
@Override
public void deleteStdNms(Long id) {
// 校验存在
validateStdNmsExists(id);
// 删除
stdNmsMapper.deleteById(id);
}
@Override
public void deleteStdNmsListByIds(List<Long> ids) {
// 校验存在
validateStdNmsExists(ids);
// 删除
stdNmsMapper.deleteByIds(ids);
}
private void validateStdNmsExists(List<Long> ids) {
List<StdNmsDO> list = stdNmsMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(STD_NMS_NOT_EXISTS);
}
}
private void validateStdNmsExists(Long id) {
if (stdNmsMapper.selectById(id) == null) {
throw exception(STD_NMS_NOT_EXISTS);
}
}
@Override
public StdNmsDO getStdNms(Long id) {
return stdNmsMapper.selectById(id);
}
@Override
public PageResult<StdNmsDO> getStdNmsPage(StdNmsPageReqVO pageReqVO) {
return stdNmsMapper.selectPage(pageReqVO);
}
}