|
|
@@ -3,7 +3,9 @@ package cn.com.yusys.yusp.controller;
|
|
|
import cn.com.yusys.yusp.annotation.ApiOperationType;
|
|
|
import cn.com.yusys.yusp.commons.exception.BizException;
|
|
|
import cn.com.yusys.yusp.commons.module.adapter.web.rest.ResultDto;
|
|
|
+import cn.com.yusys.yusp.domain.dto.TagInfoDetailDto;
|
|
|
import cn.com.yusys.yusp.domain.dto.TagInfoDto;
|
|
|
+import cn.com.yusys.yusp.domain.dto.TagInfoPageDto;
|
|
|
import cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity;
|
|
|
import cn.com.yusys.yusp.domain.vo.*;
|
|
|
import cn.com.yusys.yusp.domain.vo.fastapivo.AiTaggingResponseVo;
|
|
|
@@ -20,6 +22,7 @@ import org.springframework.core.io.Resource;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -57,13 +60,26 @@ public class AitagTagInfoController {
|
|
|
/**
|
|
|
* 列表查询
|
|
|
*
|
|
|
- * @param aitagTagInfoQueryVo
|
|
|
+ * @param dto
|
|
|
* @return ResultDto
|
|
|
*/
|
|
|
@ApiOperationType("列表标签分页信息")
|
|
|
- @GetMapping("/page")
|
|
|
- public ResultDto<List<AitagTagInfoEntity>> page(AitagTagInfoQueryVo aitagTagInfoQueryVo) {
|
|
|
- IPage<AitagTagInfoEntity> page = aitagTagInfoService.queryPage(aitagTagInfoQueryVo);
|
|
|
+ @PostMapping("/page")
|
|
|
+ public ResultDto<List<AitagTagInfoEntity>> page(@RequestBody TagInfoPageDto dto) {
|
|
|
+ AitagTagInfoQueryVo queryVo = new AitagTagInfoQueryVo();
|
|
|
+ queryVo.setCategoryId(dto.getCategoryId());
|
|
|
+ queryVo.setTagNm(dto.getTagName());
|
|
|
+ queryVo.setTagCode(dto.getTagCode());
|
|
|
+
|
|
|
+ // 处理 state:String -> Integer
|
|
|
+ if (dto.getState() != null && !dto.getState().isEmpty()) {
|
|
|
+ queryVo.setState(Integer.valueOf(dto.getState()));
|
|
|
+ }
|
|
|
+
|
|
|
+ queryVo.setPage(dto.getPage());
|
|
|
+ queryVo.setPageSize(dto.getPageSize());
|
|
|
+
|
|
|
+ IPage<AitagTagInfoEntity> page = aitagTagInfoService.queryPage(queryVo);
|
|
|
return ResultDto.success(page.getRecords()).total(page.getTotal());
|
|
|
}
|
|
|
|
|
|
@@ -71,16 +87,49 @@ public class AitagTagInfoController {
|
|
|
/**
|
|
|
* 列表查询
|
|
|
*
|
|
|
- * @param aitagTagInfoQueryVo
|
|
|
+ * @param dto
|
|
|
* @return ResultDto
|
|
|
*/
|
|
|
@ApiOperationType("标签列表查询")
|
|
|
- @GetMapping("/list")
|
|
|
- public ResultDto<List<AitagTagInfoEntity>> list(AitagTagInfoQueryVo aitagTagInfoQueryVo) {
|
|
|
- List<AitagTagInfoEntity> page = aitagTagInfoService.queryList(aitagTagInfoQueryVo);
|
|
|
+ @PostMapping("/list")
|
|
|
+ public ResultDto<List<AitagTagInfoEntity>> list(@RequestBody TagInfoPageDto dto) {
|
|
|
+ AitagTagInfoQueryVo queryVo = new AitagTagInfoQueryVo();
|
|
|
+ queryVo.setCategoryId(dto.getCategoryId());
|
|
|
+ queryVo.setTagNm(dto.getTagName());
|
|
|
+ queryVo.setTagCode(dto.getTagCode());
|
|
|
+
|
|
|
+ // 处理 state:String -> Integer
|
|
|
+ if (dto.getState() != null && !dto.getState().isEmpty()) {
|
|
|
+ queryVo.setState(Integer.valueOf(dto.getState()));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<AitagTagInfoEntity> page = aitagTagInfoService.queryList(queryVo);
|
|
|
return ResultDto.success(page);
|
|
|
}
|
|
|
|
|
|
+// @ApiOperationType("列表标签分页信息")
|
|
|
+// @GetMapping("/page")
|
|
|
+// public ResultDto<List<AitagTagInfoEntity>> page(AitagTagInfoQueryVo aitagTagInfoQueryVo) {
|
|
|
+// IPage<AitagTagInfoEntity> page = aitagTagInfoService.queryPage(aitagTagInfoQueryVo);
|
|
|
+// return ResultDto.success(page.getRecords()).total(page.getTotal());
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 列表查询
|
|
|
+// *
|
|
|
+// * @param aitagTagInfoQueryVo
|
|
|
+// * @return ResultDto
|
|
|
+// */
|
|
|
+// @ApiOperationType("标签列表查询")
|
|
|
+// @GetMapping("/list")
|
|
|
+// public ResultDto<List<AitagTagInfoEntity>> list(AitagTagInfoQueryVo aitagTagInfoQueryVo) {
|
|
|
+// List<AitagTagInfoEntity> page = aitagTagInfoService.queryList(aitagTagInfoQueryVo);
|
|
|
+// return ResultDto.success(page);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 查询标签树
|
|
|
*
|
|
|
@@ -101,16 +150,30 @@ public class AitagTagInfoController {
|
|
|
/**
|
|
|
* 详细
|
|
|
*
|
|
|
- * @param id
|
|
|
+ * @param dto
|
|
|
* @return ResultDto
|
|
|
*/
|
|
|
@ApiOperationType("标签详细")
|
|
|
- @GetMapping("/info/{id}")
|
|
|
- public ResultDto<TagInfoDto> info(@PathVariable("id") String id) {
|
|
|
- TagInfoDto aitagTagInfo = aitagTagInfoService.getTagInfo(id);
|
|
|
+ @PostMapping("/info")
|
|
|
+ public ResultDto<TagInfoDto> info(@Validated @RequestBody TagInfoDetailDto dto) {
|
|
|
+ TagInfoDto aitagTagInfo = aitagTagInfoService.getTagInfo(dto.getId());
|
|
|
return ResultDto.success(aitagTagInfo);
|
|
|
}
|
|
|
|
|
|
+// /**
|
|
|
+// * 详细
|
|
|
+// *
|
|
|
+// * @param id
|
|
|
+// * @return ResultDto
|
|
|
+// */
|
|
|
+// @ApiOperationType("标签详细")
|
|
|
+// @GetMapping("/info/{id}")
|
|
|
+// public ResultDto<TagInfoDto> info(@PathVariable("id") String id) {
|
|
|
+// TagInfoDto aitagTagInfo = aitagTagInfoService.getTagInfo(id);
|
|
|
+// return ResultDto.success(aitagTagInfo);
|
|
|
+// }
|
|
|
+//
|
|
|
+
|
|
|
/**
|
|
|
* 保存
|
|
|
*
|
|
|
@@ -233,7 +296,8 @@ public class AitagTagInfoController {
|
|
|
* @return ResultDto
|
|
|
*/
|
|
|
@ApiOperationType("批量导入模板下载")
|
|
|
- @GetMapping("/downloadFile")
|
|
|
+ @PostMapping("/downloadFile")
|
|
|
+// @GetMapping("/downloadFile")
|
|
|
public ResponseEntity<Resource> downloadFile( ) throws IOException {
|
|
|
|
|
|
ClassPathResource resource = new ClassPathResource("template/tag_batch_Import_template.xlsx");
|