update 文档管理系统新增子类型
This commit is contained in:
parent
00c490d28f
commit
c73dc4db7b
|
@ -118,6 +118,11 @@
|
|||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ManageDocumentsController {
|
|||
|
||||
@PostMapping("/findCatalogueDocumentList")
|
||||
@ApiOperation(value = "业务系统:获取文档类型对应的文章列表")
|
||||
public R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(@RequestBody ManageCatalogueVo manageCatalogueVo){
|
||||
public TableDataInfo<ManageCatalogueDocumentDto> findCatalogueDocumentList(@RequestBody ManageCatalogueVo manageCatalogueVo){
|
||||
return manageDocumentsService.findCatalogueDocumentList(manageCatalogueVo);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,4 +39,7 @@ public class ManageCatalogueDocumentDto {
|
|||
|
||||
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
|
||||
private Integer childType;
|
||||
}
|
||||
|
|
|
@ -26,4 +26,7 @@ public class ManageCatalogueDto {
|
|||
|
||||
@ApiModelProperty(value = "文档类型",example = "1")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
|
||||
private Integer childType;
|
||||
}
|
||||
|
|
|
@ -42,4 +42,8 @@ public class ManageDocumentDto {
|
|||
|
||||
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
|
||||
private Integer childType;
|
||||
|
||||
}
|
||||
|
|
|
@ -41,9 +41,13 @@ public class ManageDocuments {
|
|||
|
||||
private Integer type;
|
||||
|
||||
private Integer childType;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface ManageDocumentsMapper extends BaseMapper<ManageDocuments> {
|
|||
* 查询所有文档类型对应的文章列表
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* 查询目录列表
|
||||
|
|
|
@ -72,7 +72,7 @@ public interface ManageDocumentsService extends IService<ManageDocuments> {
|
|||
* @param manageCatalogueVo
|
||||
* @return
|
||||
*/
|
||||
R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo);
|
||||
TableDataInfo<ManageCatalogueDocumentDto> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,6 +94,7 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
|
|||
.title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry))
|
||||
.subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry))
|
||||
.type(manageDocumentVo.getType())
|
||||
.childType(manageDocumentVo.getChildType())
|
||||
.createUser(SecurityUtils.getUsername())
|
||||
.updateUser(SecurityUtils.getUsername())
|
||||
.build();
|
||||
|
@ -107,6 +108,7 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
|
|||
.contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry))
|
||||
.titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry))
|
||||
.subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry))
|
||||
.childType(manageDocumentVo.getChildType())
|
||||
.createUser(SecurityUtils.getUsername())
|
||||
.updateUser(SecurityUtils.getUsername())
|
||||
.build();
|
||||
|
@ -142,8 +144,10 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
|
|||
.content(TranslateUtils.translate(manageDocumentVo.getContent(), toCountry, fromCountry))
|
||||
.title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry))
|
||||
.subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry))
|
||||
.childType(manageDocumentVo.getChildType())
|
||||
.createUser(SecurityUtils.getUsername())
|
||||
.updateUser(SecurityUtils.getUsername())
|
||||
.type(manageDocumentVo.getType())
|
||||
.build();
|
||||
}else{
|
||||
//中文转英文
|
||||
|
@ -155,8 +159,10 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
|
|||
.contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry))
|
||||
.titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry))
|
||||
.subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry))
|
||||
.childType(manageDocumentVo.getChildType())
|
||||
.createUser(SecurityUtils.getUsername())
|
||||
.updateUser(SecurityUtils.getUsername())
|
||||
.type(manageDocumentVo.getType())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -194,10 +200,26 @@ public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMappe
|
|||
}
|
||||
|
||||
@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());
|
||||
return R.success(catalogueDocumentList);
|
||||
private TableDataInfo<ManageCatalogueDocumentDto> getDataManageCatalogueDocument(List<ManageCatalogueDocumentDto> list)
|
||||
{
|
||||
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
|
||||
|
|
|
@ -17,10 +17,16 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "ManageCatalogueVo",description = "文档目录请求对象")
|
||||
public class ManageCatalogueVo{
|
||||
public class ManageCatalogueVo extends PageVo{
|
||||
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "语言",example = "zh")
|
||||
private String lang;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
|
||||
private Integer childType;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -37,4 +37,7 @@ public class ManageDocumentVo {
|
|||
|
||||
@ApiModelProperty(value = "语言",example = "zh中文 en英文")
|
||||
private String lang;
|
||||
|
||||
@ApiModelProperty(value = "文档子类型",example = "0没有 1服务条款、2费率、3API文档")
|
||||
private Integer childType;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,8 @@ SELECT
|
|||
update_user as updateUser,
|
||||
update_time as updateTime,
|
||||
create_time as createTime,
|
||||
type
|
||||
type,
|
||||
child_type as childType
|
||||
FROM
|
||||
manage_documents
|
||||
<where>
|
||||
|
@ -62,7 +63,8 @@ FROM
|
|||
update_user as updateUser,
|
||||
update_time as updateTime,
|
||||
create_time as createTime,
|
||||
type
|
||||
type,
|
||||
child_type as childType
|
||||
FROM
|
||||
manage_documents
|
||||
<where>
|
||||
|
@ -100,10 +102,12 @@ FROM
|
|||
update_user as updateUser,
|
||||
update_time as updateTime,
|
||||
create_time as createTime,
|
||||
type
|
||||
type,
|
||||
child_type as childType
|
||||
from
|
||||
manage_documents
|
||||
where del = false and type = #{type}
|
||||
where
|
||||
del = false and type = #{type} and child_type = #{childType}
|
||||
order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue