commit
15e56fc012
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,162 @@
|
||||
package cn.jyjz.xiaoyao.ocr.controller;
|
||||
|
||||
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
|
||||
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
|
||||
import cn.jyjz.xiaoyao.common.base.util.StringUtils;
|
||||
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
||||
import cn.jyjz.xiaoyao.oa.from.dataobject.Candidateuser;
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead;
|
||||
import cn.jyjz.xiaoyao.ocr.service.IOcrMsgService;
|
||||
import cn.jyjz.xiaoyao.ocr.util.PageRequest;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import cn.jyjz.xiaoyao.ocr.service.IOcrMsgReadService;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ocr控制器
|
||||
*
|
||||
* @author 你的肉
|
||||
* @Date 2024-03-13 20:21:38
|
||||
*/
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/ocr/msg")
|
||||
public class OcrMsgReadController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IOcrMsgReadService ocrMsgReadService;
|
||||
|
||||
@Autowired
|
||||
private IOcrMsgService iocrmsgservice;
|
||||
|
||||
@Autowired
|
||||
private UserTokenService userTokenService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "系统消息分页", notes = "系统消息分页")
|
||||
@RequestMapping(value = "/systemPage", method = RequestMethod.GET)
|
||||
public ResponseEntity<?> systemPage(HttpServletRequest request,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
|
||||
@RequestParam(value = "msgCategory", required = false) String msgCategory) {
|
||||
|
||||
|
||||
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||
|
||||
|
||||
//条件查询
|
||||
PageRequest pageQuery=new PageRequest();
|
||||
pageQuery.setPageNum(pageNo);
|
||||
pageQuery.setPageSize(pageSize);
|
||||
|
||||
|
||||
PageInfo<List<Map<Object, String>>> findPage = iocrmsgservice.selectPage(pageQuery,userToken.getUserid(),msgCategory);
|
||||
|
||||
//执行查询方法
|
||||
return new ResponseEntity<Object>(findPage, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询 单条 信息
|
||||
*
|
||||
* @param id
|
||||
* @param id 编号
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "消息详情", notes = "消息详情")
|
||||
@RequestMapping(value = "/msgOne", method = RequestMethod.GET)
|
||||
public ResponseEntity<?> msgOne(@RequestParam(value = "id", required = false)String id) {
|
||||
|
||||
QueryWrapper<OcrMsg> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("titile","msg_content as msgContent","sender","msg_category as msgCategory","send_time as sendTime");
|
||||
wrapper.eq("id", id);
|
||||
//执行查询方法
|
||||
OcrMsg one = iocrmsgservice.getOne(wrapper);
|
||||
|
||||
return new ResponseEntity<Object>(one,HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "消除未读所有", notes = "消除未读所有")
|
||||
@RequestMapping(value = "eliminateUnreadfull", method = RequestMethod.POST)
|
||||
public ResponseEntity<?> eliminateUnreadfull(HttpServletRequest request,@RequestParam(value = "msgCategory", required = false)String msgCategory) {
|
||||
|
||||
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||
|
||||
QueryWrapper<OcrMsg> wrapperlist = new QueryWrapper<>();
|
||||
wrapperlist.select("id").eq("msg_category",msgCategory).eq("send_status","1").apply("FIND_IN_SET('"+userToken.getUserid()+"',receive_user_ids)");
|
||||
|
||||
QueryWrapper<OcrMsgRead> wrapperone = new QueryWrapper<>();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSS");
|
||||
|
||||
List<OcrMsg> list = iocrmsgservice.list(wrapperlist);
|
||||
for (OcrMsg msg:list){
|
||||
wrapperone.eq("msg_id", msg.getId()).eq("user_id",userToken.getUserid());
|
||||
OcrMsgRead one = ocrMsgReadService.getOne(wrapperone);
|
||||
if(null==one) {
|
||||
OcrMsgRead ocrmsgread=new OcrMsgRead();
|
||||
ocrmsgread.setId(Long.valueOf(sdf.format(System.currentTimeMillis())));
|
||||
ocrmsgread.setMsgId(msg.getId());
|
||||
ocrmsgread.setUserId(Long.valueOf(userToken.getUserid()));
|
||||
ocrmsgread.setReadFlag(1);
|
||||
ocrmsgread.setReadTime(System.currentTimeMillis());
|
||||
ocrMsgReadService.save(ocrmsgread);
|
||||
}
|
||||
}
|
||||
//此处需要手工处理 返回需要将修改后的数据返回
|
||||
return new ResponseEntity<Object>("true",HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "消除未读单个", notes = "消除未读单个")
|
||||
@RequestMapping(value = "eliminateUnreadone", method = RequestMethod.POST)
|
||||
public ResponseEntity<?> eliminateUnreadone(HttpServletRequest request,@RequestParam(value = "msgid", required = false)String msgid) {
|
||||
|
||||
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSS");
|
||||
|
||||
|
||||
OcrMsgRead ocrmsgread=new OcrMsgRead();
|
||||
ocrmsgread.setId(Long.valueOf(sdf.format(System.currentTimeMillis())));
|
||||
ocrmsgread.setMsgId(Long.valueOf(msgid));
|
||||
ocrmsgread.setUserId(Long.valueOf(userToken.getUserid()));
|
||||
ocrmsgread.setReadFlag(1);
|
||||
ocrmsgread.setReadTime(System.currentTimeMillis());
|
||||
|
||||
boolean save = ocrMsgReadService.save(ocrmsgread);
|
||||
//此处需要手工处理 返回需要将修改后的数据返回
|
||||
return new ResponseEntity<Object>(save,HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package cn.jyjz.xiaoyao.ocr.controller;
|
||||
|
||||
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
|
||||
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
|
||||
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead;
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ocr控制器
|
||||
*
|
||||
* @author 你的肉
|
||||
* @Date 2024-03-15 19:53:30
|
||||
*/
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/ocr/history")
|
||||
public class OcrSearchHistoryController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IOcrSearchHistoryService ocrSearchHistoryService;
|
||||
|
||||
@Autowired
|
||||
private UserTokenService userTokenService;
|
||||
|
||||
/**
|
||||
* 搜索查询
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/searchList", method = RequestMethod.GET)
|
||||
public ResponseEntity<?> searchList(HttpServletRequest request,
|
||||
@RequestParam(value = "search", required = false) String search) {
|
||||
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||
//执行查询方法
|
||||
List<String> selectsearch = ocrSearchHistoryService.selectsearch(search, userToken.getUsername());
|
||||
|
||||
OcrSearchHistory ocrsearchhistory =new OcrSearchHistory();
|
||||
ocrsearchhistory.setHistoryname(search);
|
||||
ocrsearchhistory.setUserid(Long.valueOf(userToken.getUserid()));
|
||||
ocrsearchhistory.setCreatedate(System.currentTimeMillis());
|
||||
ocrSearchHistoryService.save(ocrsearchhistory);
|
||||
|
||||
return new ResponseEntity<Object>(selectsearch, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过 删除历史记录
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/searchdelete", method = RequestMethod.DELETE)
|
||||
public ResponseEntity<?> searchdelete(HttpServletRequest request) {
|
||||
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||
QueryWrapper<OcrSearchHistory> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("userid",userToken.getUserid());
|
||||
//根据具体情况 判断 是否需要 进行数据返回, 默认不返回数据
|
||||
ocrSearchHistoryService.remove(wrapper);
|
||||
return new ResponseEntity<Object>("true",HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 历史搜索
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/historySearch", method = RequestMethod.GET)
|
||||
public ResponseEntity<?> historySearch(HttpServletRequest request) {
|
||||
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||
|
||||
QueryWrapper<OcrSearchHistory> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("historyname","createdate").eq("userid",userToken.getUserid()).orderByDesc("createdate").last("limit 8");
|
||||
List<OcrSearchHistory> list = ocrSearchHistoryService.list(wrapper);
|
||||
|
||||
return new ResponseEntity<List<OcrSearchHistory>>(list, HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.jyjz.xiaoyao.ocr.dataDao;
|
||||
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface OcrMsgMapper extends BaseMapper<OcrMsg> {
|
||||
List<List<Map<Object, String>>> selectPage(@Param("userid")String userid,@Param("msgCategory")String msgCategory);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.jyjz.xiaoyao.ocr.dataDao;
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface OcrMsgReadMapper extends BaseMapper<OcrMsgRead> {
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.jyjz.xiaoyao.ocr.dataDao;
|
||||
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import liquibase.pro.packaged.S;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 综合搜索历史表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface OcrSearchHistoryMapper extends BaseMapper<OcrSearchHistory> {
|
||||
List<String> selectsearch(@Param("search")String search,@Param("assignee") String assignee);
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package cn.jyjz.xiaoyao.ocr.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-13
|
||||
*/
|
||||
@TableName("ocr_msg_read")
|
||||
public class OcrMsgRead extends Model<OcrMsgRead> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 消息id
|
||||
*/
|
||||
@TableField("msg_id")
|
||||
private Long msgId;
|
||||
/**
|
||||
* 读取用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 1.已读
|
||||
*/
|
||||
@TableField("read_flag")
|
||||
private Integer readFlag;
|
||||
/**
|
||||
* 读取时间戳
|
||||
*/
|
||||
@TableField("read_time")
|
||||
private Long readTime;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getMsgId() {
|
||||
return msgId;
|
||||
}
|
||||
|
||||
public void setMsgId(Long msgId) {
|
||||
this.msgId = msgId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getReadFlag() {
|
||||
return readFlag;
|
||||
}
|
||||
|
||||
public void setReadFlag(Integer readFlag) {
|
||||
this.readFlag = readFlag;
|
||||
}
|
||||
|
||||
public Long getReadTime() {
|
||||
return readTime;
|
||||
}
|
||||
|
||||
public void setReadTime(Long readTime) {
|
||||
this.readTime = readTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OcrMsgRead{" +
|
||||
"id=" + id +
|
||||
", msgId=" + msgId +
|
||||
", userId=" + userId +
|
||||
", readFlag=" + readFlag +
|
||||
", readTime=" + readTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package cn.jyjz.xiaoyao.ocr.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 综合搜索历史表
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-15
|
||||
*/
|
||||
@TableName("ocr_search_history")
|
||||
public class OcrSearchHistory extends Model<OcrSearchHistory> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 历史主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 搜索历史名称
|
||||
*/
|
||||
private String historyname;
|
||||
|
||||
public Long getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Long userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Long userid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Long createdate;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getHistoryname() {
|
||||
return historyname;
|
||||
}
|
||||
|
||||
public void setHistoryname(String historyname) {
|
||||
this.historyname = historyname;
|
||||
}
|
||||
|
||||
public Long getCreatedate() {
|
||||
return createdate;
|
||||
}
|
||||
|
||||
public void setCreatedate(Long createdate) {
|
||||
this.createdate = createdate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OcrSearchHistory{" +
|
||||
"id=" + id +
|
||||
", historyname=" + historyname +
|
||||
", userid=" + userid +
|
||||
", createdate=" + createdate +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.jyjz.xiaoyao.ocr.service;
|
||||
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-13
|
||||
*/
|
||||
public interface IOcrMsgReadService extends IService<OcrMsgRead> {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cn.jyjz.xiaoyao.ocr.service;
|
||||
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 综合搜索历史表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-15
|
||||
*/
|
||||
public interface IOcrSearchHistoryService extends IService<OcrSearchHistory> {
|
||||
List<String> selectsearch(String search,String assignee);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cn.jyjz.xiaoyao.ocr.service.impl;
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataDao.OcrMsgReadMapper;
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead;
|
||||
import cn.jyjz.xiaoyao.ocr.service.IOcrMsgReadService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-13
|
||||
*/
|
||||
@Service
|
||||
public class OcrMsgReadServiceImpl extends ServiceImpl<OcrMsgReadMapper, OcrMsgRead> implements IOcrMsgReadService {
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.jyjz.xiaoyao.ocr.service.impl;
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataDao.OcrMsgMapper;
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
|
||||
import cn.jyjz.xiaoyao.ocr.service.IOcrMsgService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.jyjz.xiaoyao.ocr.util.PageRequest;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-13
|
||||
*/
|
||||
@Service
|
||||
public class OcrMsgServiceImpl extends ServiceImpl<OcrMsgMapper, OcrMsg> implements IOcrMsgService {
|
||||
|
||||
@Resource
|
||||
OcrMsgMapper ocrmsgmapper;
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<List<Map<Object,String>>> selectPage(PageRequest pageRequest,String userid, String msgCategory) {
|
||||
int pageNum = pageRequest.getPageNum();
|
||||
int pageSize = pageRequest.getPageSize();
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<List<Map<Object, String>>> selectPage = ocrmsgmapper.selectPage(userid,msgCategory);
|
||||
return new PageInfo<List<Map<Object,String>>>(selectPage);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.jyjz.xiaoyao.ocr.service.impl;
|
||||
|
||||
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
|
||||
import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.jyjz.xiaoyao.ocr.dataDao.OcrSearchHistoryMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 综合搜索历史表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 你的肉123
|
||||
* @since 2024-03-15
|
||||
*/
|
||||
@Service
|
||||
public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMapper, OcrSearchHistory> implements IOcrSearchHistoryService {
|
||||
|
||||
@Resource
|
||||
OcrSearchHistoryMapper ocrsearchhistorymapper;
|
||||
|
||||
@Override
|
||||
public List<String> selectsearch(String search, String assignee) {
|
||||
return ocrsearchhistorymapper.selectsearch(search,assignee);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.jyjz.xiaoyao.ocr.util;
|
||||
/**
|
||||
* 分页请求
|
||||
*/
|
||||
public class PageRequest {
|
||||
/**
|
||||
* 当前页码
|
||||
*/
|
||||
private int pageNum;
|
||||
/**
|
||||
* 每页数量
|
||||
*/
|
||||
private int pageSize;
|
||||
|
||||
public int getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
public void setPageNum(int pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
<?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="cn.jyjz.xiaoyao.ocr.dataDao.OcrMsgMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg">
|
||||
<id column="id" property="id" />
|
||||
<result column="titile" property="titile" />
|
||||
<result column="msg_content" property="msgContent" />
|
||||
<result column="sender" property="sender" />
|
||||
<result column="msg_category" property="msgCategory" />
|
||||
<result column="receive_user_type" property="receiveUserType" />
|
||||
<result column="bus_json" property="busJson" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="receive_user_ids" property="receiveUserIds" />
|
||||
<result column="open_type" property="openType" />
|
||||
<result column="open_page" property="openPage" />
|
||||
<result column="send_status" property="sendStatus" />
|
||||
<result column="send_time" property="sendTime" />
|
||||
<result column="cancel_time" property="cancelTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, titile, msg_content AS msgContent, sender, msg_category AS msgCategory, receive_user_type AS receiveUserType, bus_json AS busJson, create_time AS createTime, create_by AS createBy, update_time AS updateTime, update_by AS updateBy, receive_user_ids AS receiveUserIds, open_type AS openType, open_page AS openPage, send_status AS sendStatus, send_time AS sendTime, cancel_time AS cancelTime
|
||||
</sql>
|
||||
|
||||
<select id="selectPage" resultType="map">
|
||||
|
||||
<if test='msgCategory == "2" '>
|
||||
SELECT
|
||||
id,
|
||||
titile,
|
||||
"系统管理员" as userNcame,
|
||||
bus_json as busJson,
|
||||
send_time as sendTime
|
||||
FROM
|
||||
ocr_msg
|
||||
WHERE
|
||||
msg_category = '2'
|
||||
AND
|
||||
receive_user_type = '1'
|
||||
AND FIND_IN_SET( ""#{userid}"", receive_user_ids )
|
||||
|
||||
UNION ALL
|
||||
SELECT
|
||||
id,
|
||||
titile,
|
||||
"系统管理员" as userNcame,
|
||||
bus_json as busJson,
|
||||
send_time as sendTime
|
||||
FROM
|
||||
ocr_msg
|
||||
WHERE
|
||||
msg_category = '2'
|
||||
AND
|
||||
receive_user_type = '2'
|
||||
</if>
|
||||
|
||||
<if test='msgCategory == "1" '>
|
||||
SELECT
|
||||
m.id as id,
|
||||
m.titile as titile,
|
||||
u.USERNAME as userName,
|
||||
m.bus_json as busJson,
|
||||
m.send_time as sendTime
|
||||
FROM
|
||||
ocr_msg m LEFT JOIN s_user_t u ON m.sender=u.ID
|
||||
WHERE
|
||||
m.msg_category = '1'
|
||||
AND
|
||||
m.receive_user_type = '1'
|
||||
AND FIND_IN_SET( ""#{userid}"", m.receive_user_ids )
|
||||
|
||||
UNION ALL
|
||||
SELECT
|
||||
m.id as id,
|
||||
m.titile as titile,
|
||||
u.USERNAME as userName,
|
||||
m.bus_json as busJson,
|
||||
m.send_time as sendTime
|
||||
FROM
|
||||
ocr_msg m LEFT JOIN s_user_t u ON m.sender=u.ID
|
||||
WHERE
|
||||
m.msg_category = '1'
|
||||
AND
|
||||
m.receive_user_type = '2'
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,19 @@
|
||||
<?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="cn.jyjz.xiaoyao.ocr.dataDao.OcrMsgReadMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead">
|
||||
<id column="id" property="id" />
|
||||
<result column="msg_id" property="msgId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="read_flag" property="readFlag" />
|
||||
<result column="read_time" property="readTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, msg_id AS msgId, user_id AS userId, read_flag AS readFlag, read_time AS readTime
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,43 @@
|
||||
<?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="cn.jyjz.xiaoyao.ocr.dataDao.OcrSearchHistoryMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory">
|
||||
<id column="id" property="id" />
|
||||
<result column="historyname" property="historyname" />
|
||||
<result column="userid" property="userid" />
|
||||
<result column="createdate" property="createdate" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, historyname, userid, createdate
|
||||
</sql>
|
||||
|
||||
<select id="selectsearch" resultType="map">
|
||||
|
||||
SELECT
|
||||
|
||||
CONCAT_WS("-",r.FROMTASKNAME,t.planName) as name
|
||||
FROM
|
||||
ocr_taskchild_picture r
|
||||
LEFT JOIN ocr_picture t ON r.PICTUREID = t.ID
|
||||
WHERE
|
||||
r.STATES='1'
|
||||
and
|
||||
r.ASSIGNEE=#{assignee}
|
||||
AND
|
||||
r.FROMTASKID like "%"#{search}"%"
|
||||
OR r.FROMTASKNAME like "%"#{search}"%"
|
||||
OR t.field1 like "%"#{search}"%"
|
||||
ORDER BY r.CREATEDATE DESC
|
||||
LIMIT 3
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
active: pro
|
Loading…
Reference in new issue