Commit a5a4a078 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 30e09776 17d85dd0
......@@ -252,6 +252,19 @@
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<build>
......
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();
}
}
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.LogMessageEntity;
import io.office.modules.manage.service.LogMessageService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author tgl
* @email
* @date 2021-12-08 11:04:42
*/
@RestController
@RequestMapping("/logmessage")
public class LogMessageController {
@Autowired
private LogMessageService logMessageService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:logmessage:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = logMessageService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:logmessage:info")
public R info(@PathVariable("id") Integer id){
LogMessageEntity logMessage = logMessageService.getById(id);
return R.ok().put("logMessage", logMessage);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:logmessage:save")
public R save(@RequestBody LogMessageEntity logMessage){
logMessageService.save(logMessage);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:logmessage:update")
public R update(@RequestBody LogMessageEntity logMessage){
logMessageService.updateById(logMessage);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:logmessage:delete")
public R delete(@RequestBody Integer[] ids){
logMessageService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
......@@ -339,5 +339,20 @@ public class NewsController extends AbstractController {
PageUtils pageUtils = new PageUtils(page);
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> {
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.LogMessageEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 11:04:42
*/
@Mapper
public interface LogMessageDao extends BaseMapper<LogMessageEntity> {
}
......@@ -59,4 +59,9 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<PolicyEntity> ycxgbzList();
List<PolicyEntity> zcfgList(NewsParams newsParams, Page page);
List<GlossaryEntity> glossaryList(@Param("newsParams") NewsParams newsParams);
List<KnowledgeinfoEntity> selectTips(NewsParams newsParams);
}
......@@ -3,6 +3,8 @@ package io.office.modules.manage.dao;
import io.office.modules.manage.entity.TimescodeRegiEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* ${comments}
......@@ -13,5 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface TimescodeRegiDao extends BaseMapper<TimescodeRegiEntity> {
@Select("select * from timescode_regi where phone=#{phone} ")
TimescodeRegiEntity findByPhone(@Param("phone") String phone);
}
......@@ -3,6 +3,8 @@ package io.office.modules.manage.dao;
import io.office.modules.manage.entity.TimescodeRegiIpEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* ${comments}
......@@ -13,5 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface TimescodeRegiIpDao extends BaseMapper<TimescodeRegiIpEntity> {
@Select("select * form timescode_regi_ip where ip = #{ip} ")
public TimescodeRegiIpEntity findByIp(@Param("ip") String ip);
}
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;
}
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 11:04:42
*/
@Data
@TableName("log_message")
public class LogMessageEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId
private Integer id;
/**
* 用户名
*/
private String username;
/**
* 手机号
*/
private String phone;
/**
*时间
*/
private Date time;
/**
* 短信内容
*/
private String pass;
/**
* ip
*/
private String ip;
/**
* 服务器IP
*/
private String url;
/**
* 分类
*/
private String type;
/**
* 发送状态
*/
private String state;
public LogMessageEntity(String username, String phone, Date time, String pass, String ip, String url, String type, String state) {
this.username = username;
this.phone = phone;
this.time = time;
this.pass = pass;
this.ip = ip;
this.url = url;
this.type = type;
this.state = state;
}
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.data.annotation.Id;
/**
* 验证码实体
......@@ -22,7 +24,7 @@ public class TimescodeRegiEntity implements Serializable {
/**
* 手机号
*/
@TableId(type = IdType.INPUT)
private String phone;
/**
* 时间
......
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -22,7 +23,7 @@ public class TimescodeRegiIpEntity implements Serializable {
/**
* $column.comments
*/
@TableId
@TableId(type = IdType.INPUT)
private String ip;
/**
* $column.comments
......
......@@ -30,4 +30,6 @@ public class NewsParams extends PageParams {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTimeEnd;
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);
}
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.LogMessageEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-08 11:04:42
*/
public interface LogMessageService extends IService<LogMessageEntity> {
PageUtils queryPage(Map<String, Object> params);
}
......@@ -60,5 +60,9 @@ public interface NewsService extends IService<NewsEntity> {
List<PolicyEntity> ycxgbzList();
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
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.LogMessageDao;
import io.office.modules.manage.entity.LogMessageEntity;
import io.office.modules.manage.service.LogMessageService;
@Service("logMessageService")
public class LogMessageServiceImpl extends ServiceImpl<LogMessageDao, LogMessageEntity> implements LogMessageService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<LogMessageEntity> page = this.page(
new Query<LogMessageEntity>().getPage(params),
new QueryWrapper<LogMessageEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
......@@ -213,5 +213,17 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
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 @@
<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>
<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>
\ 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.TimescodeRegiIpDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.TimescodeRegiIpEntity" id="timescodeRegiIpMap">
<result property="ip" column="ip"/>
<result property="date" column="date"/>
<result property="timesIp" column="times_ip"/>
</resultMap>
</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