Commit 85bae1c9 by 吴迪

【修改】知识管理

parent ee54424b
......@@ -527,6 +527,8 @@ ALTER COLUMN directpath varchar(200);
ALTER TABLE NewTopic
ALTER COLUMN Ppath varchar(200);
CREATE TABLE [dbo].[logistics] (
[id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[title] varchar(50) COLLATE Chinese_PRC_CI_AS NULL ,
......
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.KnowledgecategoryEntity;
import io.office.modules.manage.service.KnowledgecategoryService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-06-07 14:27:45
*/
@RestController
@RequestMapping("/knowledgecategory")
public class KnowledgecategoryController {
@Autowired
private KnowledgecategoryService knowledgecategoryService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:knowledgecategory:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = knowledgecategoryService.queryPage(params);
return R.ok().put("data", page);
}
/**
* 信息
*/
@RequestMapping("/info/{knowledgecategoryid}")
// @RequiresPermissions("manage:knowledgecategory:info")
public R info(@PathVariable("knowledgecategoryid") Integer knowledgecategoryid){
KnowledgecategoryEntity knowledgecategory = knowledgecategoryService.getById(knowledgecategoryid);
return R.ok().put("data", knowledgecategory);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:knowledgecategory:save")
public R save(@RequestBody KnowledgecategoryEntity knowledgecategory){
knowledgecategoryService.save(knowledgecategory);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:knowledgecategory:update")
public R update(@RequestBody KnowledgecategoryEntity knowledgecategory){
knowledgecategoryService.updateById(knowledgecategory);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:knowledgecategory:delete")
public R delete(@RequestBody Integer[] knowledgecategoryids){
knowledgecategoryService.removeByIds(Arrays.asList(knowledgecategoryids));
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/getFirstLevelCategory")
// @RequiresPermissions("manage:knowledgecategory:getFirstLevelCategory")
public R getFirstLevelCategory(){
QueryWrapper<KnowledgecategoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("categorylevels","1");
return R.ok().put("data",knowledgecategoryService.list(queryWrapper));
}
@RequestMapping("/getSecondLevelCategory")
// @RequiresPermissions("manage:knowledgecategory:getFirstLevelCategory")
public R getSecondLevelCategory(@RequestBody KnowledgecategoryEntity knowledgecategory){
QueryWrapper<KnowledgecategoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("categorylevels","2");
queryWrapper.eq("parentCategoryID",knowledgecategory.getParentcategoryid());
return R.ok().put("data",knowledgecategoryService.list(queryWrapper));
}
}
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.ProductEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.sys.controller.AbstractController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.KnowledgeinfoEntity;
......@@ -44,11 +44,11 @@ public class KnowledgeinfoController extends AbstractController {
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:knowledgeinfo:list")
public R list(@RequestBody NewsParams params){
public R list(@RequestBody KnowledgeCategoryVo params){
Page<KnowledgeinfoEntity> page = this.knowledgeinfoService.knowledgeinfoList(params,
new Page(params.getPage(), params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
return R.ok().put("data", pageUtils);
}
......@@ -60,7 +60,7 @@ public class KnowledgeinfoController extends AbstractController {
public R info(@PathVariable("knowledgeinfoid") Integer knowledgeinfoid){
KnowledgeinfoEntity knowledgeinfo = knowledgeinfoService.getById(knowledgeinfoid);
return R.ok().put("knowledgeinfo", knowledgeinfo);
return R.ok().put("data", knowledgeinfo);
}
/**
......
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.KnowledgecategoryEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-06-07 14:27:45
*/
@Mapper
public interface KnowledgecategoryDao extends BaseMapper<KnowledgecategoryEntity> {
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.KnowledgeinfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.entity.dto.NewsParams;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -20,5 +21,5 @@ import java.util.List;
@Mapper
public interface KnowledgeinfoDao extends BaseMapper<KnowledgeinfoEntity> {
List<KnowledgeinfoEntity> knowledgeinfoList(@Param("newsParams") NewsParams params, Page page);
List<KnowledgeinfoEntity> knowledgeinfoList(@Param("newsParams") KnowledgeCategoryVo params, Page page);
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-06-07 14:27:45
*/
@Data
@TableName("knowledgeCategory")
public class KnowledgecategoryEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer knowledgecategoryid;
/**
* $column.comments
*/
private Integer categorylevels;
/**
* $column.comments
*/
private String description;
/**
* $column.comments
*/
private Integer parentcategoryid;
/**
* $column.comments
*/
private Integer levels;
/**
* $column.comments
*/
private String isshow;
}
package io.office.modules.manage.entity.dto;
import io.office.modules.manage.entity.page.PageParams;
import lombok.Data;
import java.util.List;
/**
* @author rkl
* @description 文章管理入参实体类
* @date 2021/10/14
*/
@Data
public class KnowledgeCategoryVo extends PageParams {
private String title;
private String levels;
private String author;
private String editor;
private String keyword;
private String status;
private String auditor;
private String releaseTimeStart;
private String releaseTimeEnd;
private String updateTimeStart;
private String updateTimeEnd;
private Integer classId;
private String type;
private List list;
private String firmname;
private String technology;
private String service;
/**一级分类*/
private String parentCategoryId;
/**二级分类*/
private String categoryId;
private String clanguage;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.KnowledgecategoryEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2022-06-07 14:27:45
*/
public interface KnowledgecategoryService extends IService<KnowledgecategoryEntity> {
PageUtils queryPage(Map<String, Object> params);
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.KnowledgeinfoEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.entity.dto.NewsParams;
import java.util.Map;
......@@ -20,6 +21,6 @@ public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> {
PageUtils queryPage(Map<String, Object> params);
Page<KnowledgeinfoEntity> knowledgeinfoList(NewsParams params, Page page);
Page<KnowledgeinfoEntity> knowledgeinfoList(KnowledgeCategoryVo params, Page page);
}
package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.KnowledgecategoryDao;
import io.office.modules.manage.entity.KnowledgecategoryEntity;
import io.office.modules.manage.service.KnowledgecategoryService;
@Service("knowledgecategoryService")
public class KnowledgecategoryServiceImpl extends ServiceImpl<KnowledgecategoryDao, KnowledgecategoryEntity> implements KnowledgecategoryService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<KnowledgecategoryEntity> page = this.page(
new Query<KnowledgecategoryEntity>().getPage(params),
new QueryWrapper<KnowledgecategoryEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.entity.dto.NewsParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -37,7 +38,7 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know
}
@Override
public Page<KnowledgeinfoEntity> knowledgeinfoList(NewsParams params, Page page) {
public Page<KnowledgeinfoEntity> knowledgeinfoList(KnowledgeCategoryVo params, Page page) {
List<KnowledgeinfoEntity> retList = this.knowledgeinfoDao.knowledgeinfoList(params,page);
page.setRecords(retList);
return page;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.office.modules.manage.dao.KnowledgecategoryDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.KnowledgecategoryEntity" id="knowledgecategoryMap">
<result property="knowledgecategoryid" column="knowledgeCategoryID"/>
<result property="categorylevels" column="CategoryLevels"/>
<result property="description" column="description"/>
<result property="parentcategoryid" column="parentCategoryID"/>
<result property="levels" column="Levels"/>
<result property="isshow" column="isShow"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -31,7 +31,7 @@
LEFT JOIN knowledgeCategory c ON b.parentCategoryID = c.knowledgeCategoryID
WHERE 1=1
<choose>
<when test="newsParams.levels !=null">
<when test="newsParams.levels !=null and newsParams.levels !=''">
AND a.levels = #{newsParams.levels}
</when>
<otherwise>
......@@ -44,7 +44,7 @@
<if test="newsParams.status !=null and newsParams.status !=''">
and a.status =#{newsParams.status}
</if>
<if test="newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=null">
<if test="newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=null and newsParams.releaseTimeStart !='' and newsParams.releaseTimeEnd !='' ">
and a.inputdate BETWEEN #{newsParams.releaseTimeStart} AND #{newsParams.releaseTimeEnd}
</if>
<if test="newsParams.parentCategoryId !=null and newsParams.parentCategoryId !=''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment