ソースを参照

Merge remote-tracking branch 'origin/dev' into dev

Blizzard 11 ヶ月 前
コミット
6366524e0a

+ 7 - 0
blade-service/wutong-okr/src/main/java/com/wtkj/controller/ProjectController.java

@@ -180,5 +180,12 @@ public class ProjectController {
 		return R.data(taskService.projectTaskBurnout(stageId));
 	}
 
+	@GetMapping("/big-data-count")
+	@ApiOperation(value = "大屏统计", notes = "")
+	@ApiOperationSupport(order = 13)
+	public R bigDataCount() {
+		return R.data(projectService.bigDataCount());
+	}
+
 
 }

+ 2 - 0
blade-service/wutong-okr/src/main/java/com/wtkj/service/IProjectService.java

@@ -7,6 +7,7 @@ import com.wtkj.vo.ProjectStatisticsVO;
 import org.springblade.core.mp.base.BaseService;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Blizzard
@@ -23,4 +24,5 @@ public interface IProjectService extends BaseService<Project> {
 
 	boolean delete(List<Long> projectIds);
 
+	Map bigDataCount();
 }

+ 17 - 4
blade-service/wutong-okr/src/main/java/com/wtkj/service/impl/ProjectServiceImpl.java

@@ -25,11 +25,9 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.wtkj.config.MagicValue.*;
@@ -329,4 +327,19 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, Project>
 		return removeByIds(projectIds);
 	}
 
+	@Override
+	public Map bigDataCount() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		Map map = new HashMap<>();
+		LambdaQueryWrapper<Project> lqw = new LambdaQueryWrapper<>();
+		map.put("projectCount",baseMapper.selectCount(lqw));//项目总数
+		lqw.like(Project::getCreateTime, sdf.format(new Date()));
+		map.put("todayAddProjectCount",baseMapper.selectCount(lqw));//今日新增项目数
+		LambdaQueryWrapper<Task> tlqw = new LambdaQueryWrapper<>();
+		map.put("taskCount",taskService.count(tlqw));//任务总数
+		tlqw.like(Task::getCreateTime,sdf.format(new Date()));
+		map.put("todayAddTaskCount",taskService.count(tlqw));//今日完成项目总数
+		return map;
+	}
+
 }