用户反馈代码生成模板文件不对,对照 ruoyi-backstage/basics/PtParameter 实际代码分析发现多处差异。
模板文件修正(3个):
ServiceImpl.java.template — 最大改动
baseMapper.selectVoList(bo) / baseMapper.selectVoPageList(bo, pageQuery) — 编译不通过的方法签名LambdaQueryWrapper + buildQueryWrapper 私有方法validEntityBeforeSave 保存前校验方法insertByBo 增加主键回填 + Objects.requireNonNull 校验updateByBo 增加 null 检查 + validEntityBeforeSavedeleteWithValidByIds 增加 isValid 校验预留位置orderByDesc(createTime)${queryWrapperConditions} 和 ${PkCapField}Mapper.java.template — 删除多余的 Bo import(Mapper 不需要引入 Bo)
Service.java.template — 删除多余的 Domain import(Service 接口不引入实体类)
已生成代码修正(3个 ServiceImpl + 3个 Service 接口 + 3个 Mapper):
EcsTermServiceImpl — 完整 CRUD + buildQueryWrapper(termName like, termNumb like, termType eq, roomId eq)EcsAttendServiceImpl — 完整 CRUD + 保留手工考勤特殊逻辑 + buildQueryWrapperEcsSectionServiceImpl — 完整 CRUD + buildQueryWrapper(含日期范围查询)IEcsAttendService — 补充 updateByBo / deleteWithValidByIds 接口IEcsSectionService — 补充 insertByBo / updateByBo / deleteWithValidByIds 接口SKILL.md 更新:
MEMORY.md 更新:
ecs_time_slot(上课时段)| 文件 | 路径 | 说明 |
|---|---|---|
| types.ts | src/api/ecs/section/types.ts |
VO/Query 类型定义 |
| index.ts | src/api/ecs/section/index.ts |
仅 listSection + getSection |
| index.vue | src/views/ecs/section/index.vue |
列表页(搜索+表格+导出,无增删改form) |
ecs_time_slot 使用 useDictterm_type(设备类型)、term_brand(设备品牌)| 文件 | 路径 | 说明 |
|---|---|---|
| types.ts | src/api/ecs/term/types.ts |
VO/Form/Query 类型定义 |
| index.ts | src/api/ecs/term/index.ts |
完整 CRUD API |
| index.vue | src/views/ecs/term/index.vue |
列表页(搜索+表格+增删改+导入导出) |
| form.vue | src/views/ecs/term/form.vue |
表单页(双列布局+教室选择弹窗) |
min-width 替代 width(遵循前端表格列宽规范)listClassroom 分页查询 → 单选高亮 → 确认回填 roomId/roomNamewidth="120"(包含编辑+删除两个按钮)roomId(非 ptRoomId),已修正 form.vue 中的教室选择确认逻辑floorName 字段,教室选择表格改为 roomCode 列check_type(考勤方式)、push_status(推送状态)| 文件 | 路径 | 说明 |
|---|---|---|
| types.ts | src/api/ecs/attend/types.ts |
AttendVO / AttendForm / AttendQuery 类型定义 |
| index.ts | src/api/ecs/attend/index.ts |
listAttend / getAttend / addAttend(无 update/del) |
| index.vue | src/views/ecs/attend/index.vue |
列表页(搜索+表格+手工考勤按钮+导出) |
| form.vue | src/views/ecs/attend/form.vue |
手工考勤表单(级联选择+教室弹窗) |
数据字典(dictType)对应的数据库表字段类型为 varchar(16),Java 实体/Bo/Vo 中对应类型为 String(而非 Integer)。字典值虽然常为数字,但存储和传输统一使用字符串。
| 文件 | 更新内容 |
|---|---|
| MEMORY.md | 技术规范新增「字典字段类型规范」条目 |
| require/SKILL.md | 字段解析规则:fieldType=Integer → fieldType=String(4处);字段类型映射表新增 String(字典字段) 行 varchar(16);DDL生成逻辑新增字典字段说明 |
| ruoyi-backend/SKILL.md | A.5 映射表新增字典字段行 private String xxxType;注意事项新增第7条;buildQueryWrapper 规则拆分出字典字段的 StringUtils.isNotBlank 判断 |
| ykt-web-dev/SKILL.md | A.4.1 类型定义注释中标注字典字段类型;注意事项新增第10条 |
主键字段(Long 类型)不加 @ExcelProperty 注解,不参与 Excel 导出。Vo 中主键仅作为标识字段,需求文档中主键默认 excelExport: false。
| 文件 | 更新内容 |
|---|---|
| Vo.java.template | 去掉主键字段的 @ExcelProperty(value = "${pkComment}") 注解 |
| ruoyi-backend/SKILL.md | A.5 映射表主键行:@ExcelProperty("ID") → 不导出;注意事项新增第8条 |
| require/references/requirements-template.md | 主键字段模板增加 excelExport: false |
| require/SKILL.md | 字段生成规则主键增加 excelExport=false;注意事项新增第9条 |
| MEMORY.md | 技术规范新增「主键不导出 Excel」条目 |
日期和时间字段 Java 类型统一使用 java.util.Date(而非 LocalDateTime),与 BaseEntity 基类保持一致。ServiceImpl 中使用 new Date() 而非 LocalDateTime.now()。
| 文件 | 更新内容 |
|---|---|
| EcsAttend.java / Bo / Vo | LocalDateTime → Date(checkTime/uploadTime/pushTime) |
| EcsAttendServiceImpl.java | LocalDateTime.now() → new Date(),import 改为 java.util.Date |
| EcsSection.java / Bo / Vo | LocalDateTime → Date(courseDate/startTime/endTime + 范围字段) |
| EcsCourseVo.java | createTime 从 LocalDateTime → Date,删除多余 import |
| EcsCourseTeacherVo.java | createTime 从 LocalDateTime → Date,删除多余 import |
| EcsTermVo.java | 删除多余的 import java.time.LocalDateTime |
| require/SKILL.md | 日期映射 fieldType=LocalDateTime → Date;通用字段表 LocalDateTime → Date;字段类型映射表 LocalDateTime → Date |
| ruoyi-backend/SKILL.md | A.5 映射表新增 fieldType=Date 行 |
| 4个需求文档(term/attend/section/course) | 所有 LocalDateTime → Date |
| MEMORY.md | 新增「日期类型规范」条目 |