update 文档管理系统新增子类型

This commit is contained in:
yyb 2025-07-23 09:57:16 +08:00
parent 00c490d28f
commit c73dc4db7b
12 changed files with 65 additions and 11 deletions

View File

@ -118,6 +118,11 @@
<version>5.6.2</version> <version>5.6.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId> <artifactId>mybatis</artifactId>

View File

@ -84,7 +84,7 @@ public class ManageDocumentsController {
@PostMapping("/findCatalogueDocumentList") @PostMapping("/findCatalogueDocumentList")
@ApiOperation(value = "业务系统:获取文档类型对应的文章列表") @ApiOperation(value = "业务系统:获取文档类型对应的文章列表")
public R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(@RequestBody ManageCatalogueVo manageCatalogueVo){ public TableDataInfo<ManageCatalogueDocumentDto> findCatalogueDocumentList(@RequestBody ManageCatalogueVo manageCatalogueVo){
return manageDocumentsService.findCatalogueDocumentList(manageCatalogueVo); return manageDocumentsService.findCatalogueDocumentList(manageCatalogueVo);
} }

View File

@ -39,4 +39,7 @@ public class ManageCatalogueDocumentDto {
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程") @ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
private Integer type; private Integer type;
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
private Integer childType;
} }

View File

@ -26,4 +26,7 @@ public class ManageCatalogueDto {
@ApiModelProperty(value = "文档类型",example = "1") @ApiModelProperty(value = "文档类型",example = "1")
private Integer type; private Integer type;
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
private Integer childType;
} }

View File

@ -42,4 +42,8 @@ public class ManageDocumentDto {
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程") @ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
private Integer type; private Integer type;
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
private Integer childType;
} }

View File

@ -41,9 +41,13 @@ public class ManageDocuments {
private Integer type; private Integer type;
private Integer childType;
private LocalDateTime createTime; private LocalDateTime createTime;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Boolean del; private Boolean del;
} }

View File

@ -30,7 +30,7 @@ public interface ManageDocumentsMapper extends BaseMapper<ManageDocuments> {
* 查询所有文档类型对应的文章列表 * 查询所有文档类型对应的文章列表
* @return * @return
*/ */
List<ManageCatalogueDocumentDto> findCatalogueDocumentList(@Param("type") Integer type,@Param("lang") String lang); List<ManageCatalogueDocumentDto> findCatalogueDocumentList(@Param("type") Integer type,@Param("lang") String lang,@Param("childType") Integer childType);
/** /**
* 查询目录列表 * 查询目录列表

View File

@ -72,7 +72,7 @@ public interface ManageDocumentsService extends IService<ManageDocuments> {
* @param manageCatalogueVo * @param manageCatalogueVo
* @return * @return
*/ */
R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo); TableDataInfo<ManageCatalogueDocumentDto> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo);
/** /**

View File

@ -94,6 +94,7 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
.title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry)) .title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry))
.subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry)) .subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry))
.type(manageDocumentVo.getType()) .type(manageDocumentVo.getType())
.childType(manageDocumentVo.getChildType())
.createUser(SecurityUtils.getUsername()) .createUser(SecurityUtils.getUsername())
.updateUser(SecurityUtils.getUsername()) .updateUser(SecurityUtils.getUsername())
.build(); .build();
@ -107,6 +108,7 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
.contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry)) .contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry))
.titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry)) .titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry))
.subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry)) .subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry))
.childType(manageDocumentVo.getChildType())
.createUser(SecurityUtils.getUsername()) .createUser(SecurityUtils.getUsername())
.updateUser(SecurityUtils.getUsername()) .updateUser(SecurityUtils.getUsername())
.build(); .build();
@ -142,8 +144,10 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
.content(TranslateUtils.translate(manageDocumentVo.getContent(), toCountry, fromCountry)) .content(TranslateUtils.translate(manageDocumentVo.getContent(), toCountry, fromCountry))
.title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry)) .title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry))
.subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry)) .subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry))
.childType(manageDocumentVo.getChildType())
.createUser(SecurityUtils.getUsername()) .createUser(SecurityUtils.getUsername())
.updateUser(SecurityUtils.getUsername()) .updateUser(SecurityUtils.getUsername())
.type(manageDocumentVo.getType())
.build(); .build();
}else{ }else{
//中文转英文 //中文转英文
@ -155,8 +159,10 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
.contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry)) .contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry))
.titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry)) .titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry))
.subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry)) .subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry))
.childType(manageDocumentVo.getChildType())
.createUser(SecurityUtils.getUsername()) .createUser(SecurityUtils.getUsername())
.updateUser(SecurityUtils.getUsername()) .updateUser(SecurityUtils.getUsername())
.type(manageDocumentVo.getType())
.build(); .build();
} }
@ -194,10 +200,26 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
} }
@Override @Override
public R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo) { public TableDataInfo<ManageCatalogueDocumentDto> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo) {
if (manageCatalogueVo.getChildType() == null){
manageCatalogueVo.setChildType(0);
}
PageHelper.startPage(manageCatalogueVo.getPageNum(), manageCatalogueVo.getPageSize());
List<ManageCatalogueDocumentDto> catalogueDocumentList = manageDocumentsMapper.findCatalogueDocumentList(manageCatalogueVo.getType(),manageCatalogueVo.getLang(),manageCatalogueVo.getChildType());
return getDataManageCatalogueDocument(catalogueDocumentList);
}
List<ManageCatalogueDocumentDto> catalogueDocumentList = manageDocumentsMapper.findCatalogueDocumentList(manageCatalogueVo.getType(),manageCatalogueVo.getLang()); private TableDataInfo<ManageCatalogueDocumentDto> getDataManageCatalogueDocument(List<ManageCatalogueDocumentDto> list)
return R.success(catalogueDocumentList); {
TableDataInfo<ManageCatalogueDocumentDto> rspData = new TableDataInfo<ManageCatalogueDocumentDto>();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setRows(list);
rspData.setMsg("查询成功");
PageInfo<ManageCatalogueDocumentDto> pageInfo = new PageInfo<ManageCatalogueDocumentDto>(list);
rspData.setTotal(pageInfo.getTotal());
rspData.setTotalPage(pageInfo.getPages());
PageHelper.clearPage();
return rspData;
} }
@Override @Override

View File

@ -17,10 +17,16 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ApiModel(value = "ManageCatalogueVo",description = "文档目录请求对象") @ApiModel(value = "ManageCatalogueVo",description = "文档目录请求对象")
public class ManageCatalogueVo{ public class ManageCatalogueVo extends PageVo{
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程") @ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
private Integer type; private Integer type;
@ApiModelProperty(value = "语言",example = "zh") @ApiModelProperty(value = "语言",example = "zh")
private String lang; private String lang;
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
private Integer childType;
} }

View File

@ -37,4 +37,7 @@ public class ManageDocumentVo {
@ApiModelProperty(value = "语言",example = "zh中文 en英文") @ApiModelProperty(value = "语言",example = "zh中文 en英文")
private String lang; private String lang;
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
private Integer childType;
} }

View File

@ -16,7 +16,8 @@ SELECT
update_user as updateUser, update_user as updateUser,
update_time as updateTime, update_time as updateTime,
create_time as createTime, create_time as createTime,
type type,
child_type as childType
FROM FROM
manage_documents manage_documents
<where> <where>
@ -62,7 +63,8 @@ FROM
update_user as updateUser, update_user as updateUser,
update_time as updateTime, update_time as updateTime,
create_time as createTime, create_time as createTime,
type type,
child_type as childType
FROM FROM
manage_documents manage_documents
<where> <where>
@ -100,10 +102,12 @@ FROM
update_user as updateUser, update_user as updateUser,
update_time as updateTime, update_time as updateTime,
create_time as createTime, create_time as createTime,
type type,
child_type as childType
from from
manage_documents manage_documents
where del = false and type = #{type} where
del = false and type = #{type} and child_type = #{childType}
order by id desc order by id desc
</select> </select>
</mapper> </mapper>