调整统计页面问题/新增查询上一篇下一篇日志
This commit is contained in:
parent
5a1334b165
commit
a1ff6a8378
@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceNextOrUpVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstancePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceSaveReqVO;
|
||||
@ -88,12 +89,13 @@ public class LogInstanceController {
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getNextOrUp")
|
||||
@PostMapping("/getNextOrUp")
|
||||
@Operation(summary = "获取上一篇下一篇日志")
|
||||
public CommonResult<Long> getNextOrUp(@Parameter(description = "当前id") @RequestParam("id") Long id,
|
||||
@Parameter(description = "类型 0上一篇 1下一篇") @RequestParam("type") Integer type) {
|
||||
Long lastId = logInstanceService.getNextOrUp(id, type);
|
||||
return success(lastId);
|
||||
public CommonResult<LogInstanceNextOrUpVO> getNextOrUp(@RequestBody LogInstancePageReqVO dto,
|
||||
@Parameter(description = "当前id") @RequestParam("id") Long id,
|
||||
@Parameter(description = "日志tab 0我收到的 1我发出的") @RequestParam("pagingType") Integer pagingType) {
|
||||
LogInstanceNextOrUpVO vo = logInstanceService.getNextOrUp(dto, id, pagingType);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LogInstanceNextOrUpVO {
|
||||
|
||||
@Schema(description = "上一篇")
|
||||
private LogInstanceRespVO upLogInstance;
|
||||
|
||||
@Schema(description = "下一篇")
|
||||
private LogInstanceRespVO nextLogInstance;
|
||||
|
||||
}
|
@ -49,10 +49,11 @@ public interface LogInstanceMapper extends BaseMapperX<LogInstanceDO> {
|
||||
/**
|
||||
* 获取上一篇下一篇
|
||||
*
|
||||
* @param dto
|
||||
* @param id
|
||||
* @param userId
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
Long getNextOrUp(@Param("id") Long id, @Param("userId") Long userId, @Param("type") Integer type);
|
||||
LogInstanceRespVO getNextOrUp(@Param("reqVO") LogInstancePageReqVO dto, @Param("id") Long id, @Param("userId") Long userId, @Param("type") Integer type, @Param("pagingType") Integer pagingType);
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.service.worklog;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceNextOrUpVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstancePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceSaveReqVO;
|
||||
@ -8,7 +9,6 @@ import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogInstanceDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -75,6 +75,7 @@ public interface LogInstanceService {
|
||||
|
||||
/**
|
||||
* 获取用户发送的上一篇日志详情
|
||||
*
|
||||
* @param formId 日志模板编号
|
||||
* @return 日志详情
|
||||
*/
|
||||
@ -87,9 +88,11 @@ public interface LogInstanceService {
|
||||
|
||||
/**
|
||||
* 获取上一篇 下一篇
|
||||
*
|
||||
* @param dto
|
||||
* @param id
|
||||
* @param type
|
||||
* @param pagingType
|
||||
* @return
|
||||
*/
|
||||
Long getNextOrUp(Long id, Integer type);
|
||||
LogInstanceNextOrUpVO getNextOrUp(LogInstancePageReqVO dto, Long id, Integer pagingType);
|
||||
}
|
@ -5,6 +5,7 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceNextOrUpVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstancePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceSaveReqVO;
|
||||
@ -337,9 +338,14 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getNextOrUp(Long id, Integer type) {
|
||||
public LogInstanceNextOrUpVO getNextOrUp(LogInstancePageReqVO dto, Long id, Integer pagingType) {
|
||||
LogInstanceNextOrUpVO vo = new LogInstanceNextOrUpVO();
|
||||
LogInstanceRespVO upLogInstance = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 1, pagingType);
|
||||
LogInstanceRespVO nextLogInstance = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 0, pagingType);
|
||||
vo.setUpLogInstance(upLogInstance);
|
||||
vo.setNextLogInstance(nextLogInstance);
|
||||
//获取日志详情
|
||||
return logInstanceMapper.getNextOrUp(id, getLoginUserId(), type);
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,10 +130,11 @@
|
||||
GROUP BY a.id, readStatus, readCount, unReadCount, comment
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getNextOrUp" resultType="java.lang.Long">
|
||||
<select id="getNextOrUp"
|
||||
resultType="cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO">
|
||||
SELECT
|
||||
a.id
|
||||
a.id,
|
||||
a.name
|
||||
FROM
|
||||
work_log_instance_ext AS a
|
||||
LEFT JOIN work_log_read AS e ON a.id = e.log_instance_id
|
||||
@ -146,7 +147,34 @@
|
||||
<if test="type == 1">
|
||||
and a.id > #{id}
|
||||
</if>
|
||||
<if test="reqVO.type != null">
|
||||
and a.type = #{reqVO.type}
|
||||
</if>
|
||||
<if test="reqVO.deptId != null">
|
||||
and a.dept_id = #{reqVO.deptId}
|
||||
</if>
|
||||
<if test="reqVO.startUserId != null">
|
||||
and a.start_user_id = #{reqVO.startUserId}
|
||||
</if>
|
||||
<if test="reqVO.createTime != null and reqVO.createTime.length > 0">
|
||||
<if test="reqVO.createTime[0] != null">
|
||||
and a.create_time >= #{reqVO.createTime[0]}
|
||||
</if>
|
||||
<if test="reqVO.createTime[1] != null">
|
||||
and a.create_time <= #{reqVO.createTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
<if test="reqVO.unRead != null">
|
||||
and e.read_status = 0
|
||||
</if>
|
||||
<if test="pagingType == 0">
|
||||
and a.start_user_id != #{userId}
|
||||
</if>
|
||||
<if test="pagingType == 1">
|
||||
and a.start_user_id = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.create_time DESC
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
@ -80,6 +80,9 @@
|
||||
</if>) AS d ON d.start_user_id = b.use_user_id
|
||||
<where>
|
||||
b.deleted = 0
|
||||
<if test="formId != null">
|
||||
AND b.form_id = #{formId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getMyCurrentStatistics"
|
||||
|
Loading…
Reference in New Issue
Block a user