Browse Source

任务看板

wangzhuo 2 years ago
parent
commit
335a7aabf2

+ 39 - 0
blade-service-api/blade-mocha-item-api/src/main/java/org/springblade/mocha/dto/TaskDTO.java

@@ -0,0 +1,39 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.dto;
+
+import org.springblade.mocha.entity.Task;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 	任务数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskDTO extends Task {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 数量合计
+	 */
+	private Integer typeCount = 0;
+
+}

+ 175 - 0
blade-service-api/blade-mocha-item-api/src/main/java/org/springblade/mocha/entity/Task.java

@@ -0,0 +1,175 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.List;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 任务实体类
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+@Data
+@TableName("basic_task")
+@ApiModel(value = "Task对象", description = "	任务")
+public class Task implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 负责人id
+	 */
+	@ApiModelProperty(value = "负责人id")
+	private Long responsibleUserId;
+
+	/**
+	 * 负责人名
+	 */
+	@ApiModelProperty(value = "负责人名")
+	private String responsibleUserName;
+	/**
+	 * 岗位id
+	 */
+	@ApiModelProperty(value = "岗位id")
+	private Long postId;
+	/**
+	 * 岗位名
+	 */
+	@ApiModelProperty(value = "岗位名")
+	private String postName;
+	/**
+	 * 任务信息
+	 */
+	@ApiModelProperty(value = "任务信息")
+	private String tsInfo;
+	/**
+	 * 要求完成时间
+	 */
+	@ApiModelProperty(value = "要求完成时间")
+	private LocalDateTime completionTime;
+	/**
+	 * 是否紧急
+	 */
+	@ApiModelProperty(value = "是否紧急")
+	private Integer isUrgency;
+	/**
+	 * 完成时间
+	 */
+	@ApiModelProperty(value = "完成时间")
+	private LocalDateTime accomplishTime;
+	/**
+	 * 未完成原因
+	 */
+	@ApiModelProperty(value = "未完成原因")
+	private String unfinishedCause;
+	/**
+	 * 附件
+	 */
+	@ApiModelProperty(value = "附件")
+	private String accessory;
+	/**
+	 * 评价
+	 */
+	@ApiModelProperty(value = "评价")
+	private String evaluate;
+	/**
+	 * 单据类型
+	 */
+	@ApiModelProperty(value = "单据类型")
+	private Integer documentType;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 参考号
+	 */
+	@ApiModelProperty(value = "参考号")
+	private String refno;
+	/**
+	 * 状态 1待执行,2执行中,3已提交,4工单关闭
+	 */
+	@ApiModelProperty(value = "状态 1待执行,2执行中,3已提交,4工单关闭")
+	private Integer type;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建人名
+	 */
+	@ApiModelProperty(value = "创建人名")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private LocalDateTime createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	@ApiModelProperty(value = "修改名")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private LocalDateTime updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 抄送人id
+	 */
+	@ApiModelProperty(value = "抄送人id")
+	private String ccId;
+
+	/**
+	 * 租户号
+	 */
+	private String tenantId;
+
+	/**
+	 * 查询时间
+	 */
+	@TableField(exist = false)
+	private List<String> createTimeSelect;
+	/**
+	 * 是否超期
+	 */
+	@TableField(exist = false)
+	private String isDateExceeded;
+
+}

+ 39 - 0
blade-service-api/blade-mocha-item-api/src/main/java/org/springblade/mocha/vo/TaskStatisticsVO.java

@@ -0,0 +1,39 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * 	任务视图实体类
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+@Data
+@ApiModel(value = "TaskVO对象", description = "	任务")
+public class TaskStatisticsVO {
+
+	private String UserName;
+	private Integer waitingQuantity = 0;
+	private Integer carryTheQuantity = 0;
+	private Integer numberOfCommits = 0;
+	private Integer theNumberOfTimeouts = 0;
+	private Integer theNumberOfClosures = 0;
+
+}

+ 36 - 0
blade-service-api/blade-mocha-item-api/src/main/java/org/springblade/mocha/vo/TaskVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.vo;
+
+import org.springblade.mocha.entity.Task;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 	任务视图实体类
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "TaskVO对象", description = "	任务")
+public class TaskVO extends Task {
+	private static final long serialVersionUID = 1L;
+
+}

+ 193 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/controller/TaskController.java

@@ -0,0 +1,193 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.mocha.vo.TaskStatisticsVO;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.mocha.entity.Task;
+import org.springblade.mocha.vo.TaskVO;
+import org.springblade.mocha.service.ITaskService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * 	任务 控制器
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/task")
+@Api(value = "	任务", tags = "	任务接口")
+public class TaskController extends BladeController {
+
+	private final ITaskService taskService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入task")
+	public R<Task> detail(Task task) {
+		Task detail = taskService.getOne(Condition.getQueryWrapper(task));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 	任务
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入task")
+	public R list(Task task, Query query) {
+
+		TaskStatisticsVO taskStatisticsVO = taskService.statistics(AuthUtil.getTenantId());
+
+//		QueryWrapper<Task> qw = Condition.getQueryWrapper(task).orderByDesc("create_time", "responsible_user_name");
+		QueryWrapper<Task> qw = new QueryWrapper<>();
+		String tsInfo = task.getTsInfo();
+		if (tsInfo != null && !tsInfo.isEmpty()) {
+			qw.like("ts_info", tsInfo);
+		}
+		Long responsibleUserId = task.getResponsibleUserId();
+		if (responsibleUserId != null) {
+			qw.eq("responsible_user_id", responsibleUserId);
+		}
+		Long postId = task.getPostId();
+		if (postId != null) {
+			qw.eq("post_id", postId);
+		}
+		Integer type = task.getType();
+		if (type != null) {
+			qw.eq("type", type);
+		}
+		List<String> date = task.getCreateTimeSelect();
+		if (date != null) {
+			qw.ge("create_time", date.get(0))
+				.le("create_time", date.get(1));
+		}
+		qw.eq("is_deleted", 0);
+		if (AuthUtil.getUserName() != "admin") {
+			qw.and(qwa -> qwa.like("cc_id", AuthUtil.getUserId())
+				.or().eq("create_user", AuthUtil.getUserId())
+				.or().eq("responsible_user_id", AuthUtil.getUserId()));
+		}
+		qw.orderByDesc("create_time", "responsible_user_name");
+
+		IPage<Task> pages = taskService.page(Condition.getPage(query), qw);
+		for (Task record : pages.getRecords()) {
+			LocalDateTime nowTime = LocalDateTime.now();
+			if (record.getType() != 4 && nowTime.isAfter(record.getCompletionTime())) {
+				record.setIsDateExceeded("已超时");
+			} else if (record.getType() == 4 && record.getAccomplishTime().isAfter(record.getCompletionTime())) {
+				record.setIsDateExceeded("已超时");
+			} else {
+				record.setIsDateExceeded("未超时");
+			}
+		}
+		Map<String, Object> map = new HashMap<>();
+		map.put("pages", pages);
+		map.put("statistics", taskStatisticsVO);
+		return R.data(map);
+	}
+
+	/**
+	 * 自定义分页 	任务
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入task")
+	public R<IPage<TaskVO>> page(TaskVO task, Query query) {
+		IPage<TaskVO> pages = taskService.selectTaskPage(Condition.getPage(query), task);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 	任务
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入task")
+	public R save(@Valid @RequestBody Task task) {
+		task.setCreateTime(LocalDateTime.now());
+		return R.status(taskService.save(task));
+	}
+
+	/**
+	 * 修改 	任务
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入task")
+	public R update(@Valid @RequestBody Task task) {
+		task.setUpdateTime(LocalDateTime.now());
+		return R.status(taskService.updateById(task));
+	}
+
+	/**
+	 * 新增或修改 	任务
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入task")
+	public R submit(@Valid @RequestBody Task task) {
+		return R.status(taskService.saveOrUpdate(task));
+	}
+
+
+	/**
+	 * 删除 	任务
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+//		return R.status(taskService.removeByIds(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+		return R.status(taskService.deleteByIds(idList));
+	}
+
+	/**
+	 * 查询人员完成任务情况
+	 */
+	@GetMapping("/completion")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "查询人员完成任务情况", notes = "传入task")
+	public R completion(TaskVO task) {
+		List<TaskStatisticsVO> taskVOList = taskService.completion(task);
+		return R.data(taskVOList);
+	}
+
+}

+ 44 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/mapper/TaskMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.mapper;
+
+import org.springblade.mocha.dto.TaskDTO;
+import org.springblade.mocha.entity.Task;
+import org.springblade.mocha.vo.TaskVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 	任务 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+public interface TaskMapper extends BaseMapper<Task> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param task
+	 * @return
+	 */
+	List<TaskVO> selectTaskPage(IPage page, TaskVO task);
+
+	Integer deleteByIds(Long id);
+}

+ 42 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/mapper/TaskMapper.xml

@@ -0,0 +1,42 @@
+<?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="org.springblade.mocha.mapper.TaskMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="taskResultMap" type="org.springblade.mocha.entity.Task">
+        <id column="id" property="id"/>
+        <result column="responsible_user_id" property="responsibleUserId"/>
+        <result column="responsible_user_name" property="responsibleUserName"/>
+        <result column="post_id" property="postId"/>
+        <result column="post_name" property="postName"/>
+        <result column="ts_info" property="tsInfo"/>
+        <result column="completion_time" property="completionTime"/>
+        <result column="is_urgency" property="isUrgency"/>
+        <result column="unfinished_cause" property="unfinishedCause"/>
+        <result column="accessory" property="accessory"/>
+        <result column="evaluate" property="evaluate"/>
+        <result column="document_type" property="documentType"/>
+        <result column="remarks" property="remarks"/>
+        <result column="refno" property="refno"/>
+        <result column="type" property="type"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="tenant_id" property="tenantId"/>
+        <result column="cc_id" property="ccId"/>
+        <result column="accomplish_time" property="accomplishTime"/>
+    </resultMap>
+    <update id="deleteByIds">
+        UPDATE basic_task
+        SET is_deleted = 1
+        WHERE id = #{id}
+    </update>
+
+
+    <select id="selectTaskPage" resultMap="taskResultMap">
+        select * from basic_task where is_deleted = 0
+    </select>
+
+</mapper>

+ 55 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/service/ITaskService.java

@@ -0,0 +1,55 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.service;
+
+import org.springblade.mocha.dto.TaskDTO;
+import org.springblade.mocha.entity.Task;
+import org.springblade.mocha.vo.TaskStatisticsVO;
+import org.springblade.mocha.vo.TaskVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 	任务 服务类
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+public interface ITaskService extends IService<Task> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param task
+	 * @return
+	 */
+	IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task);
+
+	List<TaskStatisticsVO> completion(TaskVO task);
+
+	boolean deleteByIds(List<Long> idList);
+
+	/**
+	 * 查询统计
+	 * @param tenantId
+	 * @return
+	 */
+	TaskStatisticsVO statistics(String tenantId);
+}

+ 116 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/service/impl/TaskServiceImpl.java

@@ -0,0 +1,116 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.mocha.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.mocha.entity.Task;
+import org.springblade.mocha.vo.TaskStatisticsVO;
+import org.springblade.mocha.vo.TaskVO;
+import org.springblade.mocha.mapper.TaskMapper;
+import org.springblade.mocha.service.ITaskService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * 	任务 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-09-28
+ */
+@Service
+public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements ITaskService {
+
+	@Override
+	public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) {
+		return page.setRecords(baseMapper.selectTaskPage(page, task));
+	}
+
+	@Override
+	public List<TaskStatisticsVO> completion(TaskVO taskVO) {
+
+		LocalDateTime nowTime = LocalDateTime.now();
+		LambdaQueryWrapper<Task> lqw = new LambdaQueryWrapper<Task>()
+			.eq(Task::getTenantId, AuthUtil.getTenantId())
+			.eq(Task::getIsDeleted, 0);
+		List<Task> taskList = baseMapper.selectList(lqw);
+
+		Map<Long, List<Task>> longTaskDTOHashMap = new HashMap<>();
+
+		for (Task task : taskList) {
+			List<Task> taskDTOList = longTaskDTOHashMap.get(task.getResponsibleUserId());
+			if (taskDTOList == null) {
+				taskDTOList = new ArrayList<>();
+			}
+			taskDTOList.add(task);
+			longTaskDTOHashMap.put(task.getResponsibleUserId(), taskDTOList);
+		}
+
+		List<TaskStatisticsVO> taskStatisticsVOList = new ArrayList<>();
+		for (Long UserId : longTaskDTOHashMap.keySet()) {
+			List<Task> tasks = longTaskDTOHashMap.get(UserId);
+			TaskStatisticsVO taskStatisticsVO = getTaskStatisticsVO(tasks, nowTime);
+			taskStatisticsVOList.add(taskStatisticsVO);
+		}
+		return taskStatisticsVOList;
+	}
+
+	private static TaskStatisticsVO getTaskStatisticsVO(List<Task> tasks, LocalDateTime nowTime) {
+		TaskStatisticsVO taskStatisticsVO = new TaskStatisticsVO();
+		for (Task task : tasks) {
+			taskStatisticsVO.setUserName(task.getResponsibleUserName());
+			if (task.getType() != 4 && nowTime.isAfter(task.getCompletionTime())) {
+				taskStatisticsVO.setTheNumberOfTimeouts(taskStatisticsVO.getTheNumberOfTimeouts() + 1);
+//				continue;
+			} else if (task.getType() == 4 && task.getAccomplishTime().isAfter(task.getCompletionTime())) {
+				taskStatisticsVO.setTheNumberOfTimeouts(taskStatisticsVO.getTheNumberOfTimeouts() + 1);
+//				continue;
+			}
+			if (task.getType() == 1) {
+				taskStatisticsVO.setWaitingQuantity(taskStatisticsVO.getWaitingQuantity() + 1);
+			} else if (task.getType() == 2) {
+				taskStatisticsVO.setCarryTheQuantity(taskStatisticsVO.getCarryTheQuantity() + 1);
+			} else if (task.getType() == 3) {
+				taskStatisticsVO.setNumberOfCommits(taskStatisticsVO.getNumberOfCommits() + 1);
+			} else if (task.getType() == 4) {
+				taskStatisticsVO.setTheNumberOfClosures(taskStatisticsVO.getTheNumberOfClosures() + 1);
+			}
+		}
+		return taskStatisticsVO;
+	}
+
+	@Override
+	public boolean deleteByIds(List<Long> idList) {
+		for (Long id : idList) {
+			Integer i = baseMapper.deleteByIds(id);
+		}
+		return true;
+	}
+
+	@Override
+	public TaskStatisticsVO statistics(String tenantId) {
+		LambdaQueryWrapper<Task> lqw = new LambdaQueryWrapper<Task>().eq(Task::getTenantId, tenantId).eq(Task::getIsDeleted, 0);
+		List<Task> tasks = baseMapper.selectList(lqw);
+		LocalDateTime nowTime = LocalDateTime.now();
+		return getTaskStatisticsVO(tasks, nowTime);
+	}
+
+}