package jnpf.tmsController; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jnpf.annotation.HandleLog; import jnpf.base.ActionResult; import jnpf.base.vo.PageListVO; import jnpf.base.vo.PaginationVO; import jnpf.tmsEntity.trainrecord.TmsTrainRecordCatalogVO; import jnpf.tmsEntity.trainrecord.TmsTrainRecordListVO; import jnpf.tmsEntity.trainrecord.TmsTrainRecordQuery; import jnpf.tmsService.TmsTrainRecordService; import jnpf.util.JsonUtil; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import jakarta.servlet.http.HttpServletResponse; import java.util.List; /** * 个人培训记录(管理端按人查看)。网关 {@code /api/tms/train-record/**} → {@code /train-record/**}。 * *

培训目录与学员档案同源:只读 {@code tms_person_train}(归档写入)。

*/ @Tag(name = "TMS个人培训记录", description = "TrainRecord") @RestController @RequestMapping("/train-record") @RequiredArgsConstructor public class TmsTrainRecordController { private final TmsTrainRecordService trainRecordService; @Operation(summary = "个人培训记录分页列表(按人员档案)") @GetMapping("/list") public ActionResult> list(TmsTrainRecordQuery query) { List list = trainRecordService.getList(query); PageListVO vo = new PageListVO<>(); vo.setList(list); vo.setPagination(JsonUtil.getJsonToBean(query, PaginationVO.class)); return ActionResult.success(vo); } @Operation(summary = "个人培训目录") @GetMapping("/{id}/catalog") public ActionResult catalog(@PathVariable("id") String id, @RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "endDate", required = false) String endDate) { return ActionResult.success(trainRecordService.getCatalog(id, startDate, endDate)); } @HandleLog(moduleName = "培训履历", requestMethod = "导出") @Operation(summary = "导出个人培训目录") @GetMapping("/{id}/catalog/export") public void exportCatalog(@PathVariable("id") String id, @RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "endDate", required = false) String endDate, HttpServletResponse response) { trainRecordService.exportCatalog(id, startDate, endDate, response); } }