Commit b6909303 by rongkailun

【新增】专业术语、小贴士

parent 1f1019fa
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
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;
import io.office.modules.manage.service.KnowledgeinfoService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* 小贴士
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
@RestController
@RequestMapping("/knowledgeinfo")
public class KnowledgeinfoController {
@Autowired
private KnowledgeinfoService knowledgeinfoService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:knowledgeinfo:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = knowledgeinfoService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{knowledgeinfoid}")
// @RequiresPermissions("manage:knowledgeinfo:info")
public R info(@PathVariable("knowledgeinfoid") Integer knowledgeinfoid){
KnowledgeinfoEntity knowledgeinfo = knowledgeinfoService.getById(knowledgeinfoid);
return R.ok().put("knowledgeinfo", knowledgeinfo);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:knowledgeinfo:save")
public R save(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfoService.save(knowledgeinfo);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:knowledgeinfo:update")
public R update(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfoService.updateById(knowledgeinfo);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:knowledgeinfo:delete")
public R delete(@RequestBody Integer[] knowledgeinfoids){
knowledgeinfoService.removeByIds(Arrays.asList(knowledgeinfoids));
return R.ok();
}
}
...@@ -339,5 +339,20 @@ public class NewsController extends AbstractController { ...@@ -339,5 +339,20 @@ public class NewsController extends AbstractController {
PageUtils pageUtils = new PageUtils(page); PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils); return R.ok().put("data", pageUtils);
} }
/**专业术语*/
@Login
@PostMapping("/api/glossaryList")
public R glossaryList(@RequestBody NewsParams newsParams) {
List<GlossaryEntity> list = this.newsService.glossaryList(newsParams);
return R.ok().put("data", list);
}
/**小贴士*/
@Login
@PostMapping("/api/tips")
public R tips(NewsParams newsParams) {
List<KnowledgeinfoEntity> list = this.newsService.selectTips(newsParams);
return R.ok().put("data", list);
}
} }
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.KnowledgeinfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
@Mapper
public interface KnowledgeinfoDao extends BaseMapper<KnowledgeinfoEntity> {
}
...@@ -59,4 +59,9 @@ public interface NewsDao extends BaseMapper<NewsEntity> { ...@@ -59,4 +59,9 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<PolicyEntity> ycxgbzList(); List<PolicyEntity> ycxgbzList();
List<PolicyEntity> zcfgList(NewsParams newsParams, Page page); List<PolicyEntity> zcfgList(NewsParams newsParams, Page page);
List<GlossaryEntity> glossaryList(@Param("newsParams") NewsParams newsParams);
List<KnowledgeinfoEntity> selectTips(NewsParams newsParams);
} }
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 2021-12-08 08:59:11
*/
@Data
@TableName("knowledgeInfo")
public class KnowledgeinfoEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer knowledgeinfoid;
/**
* $column.comments
*/
private Integer knowledgecategoryid;
/**
* $column.comments
*/
private Integer levels;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String editor;
/**
* $column.comments
*/
private Date inputdate;
/**
* $column.comments
*/
private String content;
/**
* $column.comments
*/
private String directpath;
/**
* $column.comments
*/
private Integer hits;
/**
* 0等待审核、1成功、2失败
*/
private Integer status;
/**
* $column.comments
*/
private String auditor;
}
...@@ -30,4 +30,6 @@ public class NewsParams extends PageParams { ...@@ -30,4 +30,6 @@ public class NewsParams extends PageParams {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTimeEnd; private Date updateTimeEnd;
private Integer classId; private Integer classId;
private String type;
} }
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.KnowledgeinfoEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 08:59:11
*/
public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> {
PageUtils queryPage(Map<String, Object> params);
}
...@@ -60,5 +60,9 @@ public interface NewsService extends IService<NewsEntity> { ...@@ -60,5 +60,9 @@ public interface NewsService extends IService<NewsEntity> {
List<PolicyEntity> ycxgbzList(); List<PolicyEntity> ycxgbzList();
Page<PolicyEntity> zcfgList(NewsParams newsParams, Page page); Page<PolicyEntity> zcfgList(NewsParams newsParams, Page page);
List<GlossaryEntity> glossaryList(NewsParams newsParams);
List<KnowledgeinfoEntity> selectTips(NewsParams newsParams);
} }
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.KnowledgeinfoDao;
import io.office.modules.manage.entity.KnowledgeinfoEntity;
import io.office.modules.manage.service.KnowledgeinfoService;
@Service("knowledgeinfoService")
public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, KnowledgeinfoEntity> implements KnowledgeinfoService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<KnowledgeinfoEntity> page = this.page(
new Query<KnowledgeinfoEntity>().getPage(params),
new QueryWrapper<KnowledgeinfoEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
...@@ -213,5 +213,17 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements ...@@ -213,5 +213,17 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return page; return page;
} }
@Override
public List<GlossaryEntity> glossaryList(NewsParams newsParams) {
List<GlossaryEntity> list = this.newsDao.glossaryList(newsParams);
return list;
}
@Override
public List<KnowledgeinfoEntity> selectTips(NewsParams newsParams) {
List<KnowledgeinfoEntity> list = this.newsDao.selectTips(newsParams);
return list;
}
} }
\ No newline at end of file
<?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.KnowledgeinfoDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.KnowledgeinfoEntity" id="knowledgeinfoMap">
<result property="knowledgeinfoid" column="knowledgeInfoID"/>
<result property="knowledgecategoryid" column="knowledgeCategoryID"/>
<result property="levels" column="Levels"/>
<result property="title" column="Title"/>
<result property="editor" column="Editor"/>
<result property="inputdate" column="inputDate"/>
<result property="content" column="Content"/>
<result property="directpath" column="directpath"/>
<result property="hits" column="hits"/>
<result property="status" column="status"/>
<result property="auditor" column="auditor"/>
</resultMap>
</mapper>
\ No newline at end of file
...@@ -394,4 +394,34 @@ ...@@ -394,4 +394,34 @@
<select id="zcfgList" resultType="io.office.modules.manage.entity.PolicyEntity"> <select id="zcfgList" resultType="io.office.modules.manage.entity.PolicyEntity">
select * from Policy where class='法律法规' and levels>0 and status > 0 order by levels desc,releasedate desc select * from Policy where class='法律法规' and levels>0 and status > 0 order by levels desc,releasedate desc
</select> </select>
<select id="glossaryList" resultType="io.office.modules.manage.entity.GlossaryEntity" parameterType="io.office.modules.manage.entity.dto.NewsParams">
select * from Glossary t where 1=1
<if test="newsParams.type == 1">
and t.title_CN like concat(concat('%',#{newsParams.title}),'%')
</if>
<if test="newsParams.type == 2">
and t.title_EN like concat(concat('%',#{newsParams.title}),'%')
</if>
<if test="newsParams.type == 3">
and t.content like concat(concat('%',#{newsParams.title}),'%')
</if>
</select>
<select id="selectTips" resultType="io.office.modules.manage.entity.KnowledgeinfoEntity">
SELECT
*
FROM
knowledgeInfo
WHERE
(
knowledgecategoryid = 126
OR knowledgecategoryid = 127
)
AND status = 1
AND levels > 0
ORDER BY
levels DESC,
knowledgeInfoid DESC
</select>
</mapper> </mapper>
\ No newline at end of file
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