任务日历
This commit is contained in:
parent
68f0ee4bb9
commit
c782367e28
|
@ -1,19 +0,0 @@
|
||||||
package com.ruoyi.bst.CalendarTask.domain;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class CalendarTask extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.ruoyi.bst.CalendarTask.domain;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class CalendarTaskVO extends CalendarTask {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ruoyi.bst.calendarTask.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CalendarTask extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务总数")
|
||||||
|
private Integer total;
|
||||||
|
|
||||||
|
@ApiModelProperty("高优先级总数")
|
||||||
|
private Integer high;
|
||||||
|
|
||||||
|
@ApiModelProperty("bug总数")
|
||||||
|
private Integer bug;
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,11 @@
|
||||||
package com.ruoyi.bst.CalendarTask.domain;
|
package com.ruoyi.bst.calendarTask.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CalendarTaskQuery extends CalendarTaskVO {
|
public class CalendarTaskQuery extends CalendarTaskVO {
|
||||||
|
|
||||||
|
// 用户id
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.ruoyi.bst.calendarTask.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CalendarTaskVO extends CalendarTask {
|
||||||
|
|
||||||
|
// 数据所在的日期
|
||||||
|
private String taskDate;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ruoyi.bst.calendarTask.service;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.calendarTask.domain.CalendarTaskVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页日历任务
|
||||||
|
*/
|
||||||
|
public interface CalendarTaskService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<CalendarTaskVO> getTaskNumber();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.ruoyi.bst.calendarTask.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.bst.calendarTask.domain.CalendarTaskQuery;
|
||||||
|
import com.ruoyi.bst.calendarTask.domain.CalendarTaskVO;
|
||||||
|
import com.ruoyi.bst.calendarTask.service.CalendarTaskService;
|
||||||
|
import com.ruoyi.bst.task.mapper.TaskMapper;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CalendarTaskImpl implements CalendarTaskService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TaskMapper taskMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CalendarTaskVO> getTaskNumber() {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
CalendarTaskQuery calendarTaskQuery = new CalendarTaskQuery();
|
||||||
|
calendarTaskQuery.setUserId(userId);
|
||||||
|
List<CalendarTaskVO> calendarTaskVOS = taskMapper.selectCalendarTask(calendarTaskQuery);
|
||||||
|
return calendarTaskVOS;
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,14 +2,15 @@ package com.ruoyi.bst.task.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.calendarTask.domain.CalendarTaskQuery;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import com.ruoyi.bst.task.domain.Task;
|
import com.ruoyi.bst.task.domain.Task;
|
||||||
import com.ruoyi.bst.task.domain.TaskQuery;
|
import com.ruoyi.bst.task.domain.TaskQuery;
|
||||||
import com.ruoyi.bst.task.domain.TaskVO;
|
import com.ruoyi.bst.task.domain.TaskVO;
|
||||||
import com.ruoyi.common.vo.IntegerIntegerVO;
|
|
||||||
import com.ruoyi.common.vo.LongIntegerVO;
|
import com.ruoyi.common.vo.LongIntegerVO;
|
||||||
import com.ruoyi.common.vo.StringIntegerVO;
|
import com.ruoyi.common.vo.StringIntegerVO;
|
||||||
|
import com.ruoyi.bst.calendarTask.domain.CalendarTaskVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务Mapper接口
|
* 任务Mapper接口
|
||||||
|
@ -101,4 +102,16 @@ public interface TaskMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<LongIntegerVO> selectCountGroupByMemberUserId(@Param("query") TaskQuery query);
|
List<LongIntegerVO> selectCountGroupByMemberUserId(@Param("query") TaskQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取日历任务数据
|
||||||
|
* @param query
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<CalendarTaskVO> selectCalendarTask(@Param("query")CalendarTaskQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<resultMap type="TaskVO" id="TaskResult" autoMapping="true"/>
|
<resultMap type="TaskVO" id="TaskResult" autoMapping="true"/>
|
||||||
|
|
||||||
|
|
||||||
<!-- 是否逾期 -->
|
<!-- 是否逾期 -->
|
||||||
<sql id="overdue">
|
<sql id="overdue">
|
||||||
if(bt.pass_time is null, now() > bt.expire_time, bt.pass_time > bt.expire_time)
|
if(bt.pass_time is null, now() > bt.expire_time, bt.pass_time > bt.expire_time)
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
<sql id="selectTaskVo">
|
<sql id="selectTaskVo">
|
||||||
select distinct
|
select distinct
|
||||||
bt.id,
|
bt.id,
|
||||||
|
@ -257,4 +259,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
group by `key`
|
group by `key`
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCalendarTask" parameterType="CalendarTaskQuery" >
|
||||||
|
SELECT
|
||||||
|
DATE_FORMAT(t.expire_time, '%Y-%m-%d') AS task_date,
|
||||||
|
COUNT(DISTINCT t.project_id) AS total,
|
||||||
|
SUM(CASE WHEN t.level = 1 THEN 1 ELSE 0 END) AS high,
|
||||||
|
SUM(CASE WHEN t.type = 3 THEN 1 ELSE 0 END) AS bug
|
||||||
|
FROM
|
||||||
|
bst_task t
|
||||||
|
LEFT JOIN bst_task_submit tm ON t.id = tm.task_id AND tm.user_id = ${query.userId}
|
||||||
|
WHERE
|
||||||
|
(t.status < 4 OR t.status = 5)
|
||||||
|
AND t.expire_time BETWEEN '2020-01-01' AND '2026-12-31'
|
||||||
|
GROUP BY
|
||||||
|
t.expire_time
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -127,4 +127,6 @@ public interface TaskService
|
||||||
* 接取任务
|
* 接取任务
|
||||||
*/
|
*/
|
||||||
int receive(Long id, Long userId);
|
int receive(Long id, Long userId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,4 +443,6 @@ public class TaskServiceImpl implements TaskService
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.ruoyi.web.bst;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.calendarTask.domain.CalendarTaskVO;
|
||||||
|
import com.ruoyi.bst.calendarTask.service.CalendarTaskService;
|
||||||
|
import com.ruoyi.bst.task.domain.TaskQuery;
|
||||||
|
import com.ruoyi.bst.task.domain.TaskVO;
|
||||||
|
import com.ruoyi.bst.task.service.TaskAssembler;
|
||||||
|
import com.ruoyi.bst.task.service.TaskService;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bst/calenderTask")
|
||||||
|
public class CalendarTaskController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CalendarTaskService calendarTaskService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TaskAssembler taskAssembler;
|
||||||
|
|
||||||
|
// 获取总数
|
||||||
|
@GetMapping("/listNumber")
|
||||||
|
public AjaxResult getCalendarTask() {
|
||||||
|
List<CalendarTaskVO> taskNumber = calendarTaskService.getTaskNumber();
|
||||||
|
return success(taskNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -196,4 +196,5 @@ public class TaskController extends BaseController
|
||||||
public AjaxResult receive(@PathVariable Long id) {
|
public AjaxResult receive(@PathVariable Long id) {
|
||||||
return toAjax(taskService.receive(id, getUserId()));
|
return toAjax(taskService.receive(id, getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user