接口:根据taskId查询累计的任务时长
This commit is contained in:
+5
@@ -110,4 +110,9 @@ public class DiscussController {
|
||||
return discussService.findDiscussList(pageDTO);
|
||||
}
|
||||
|
||||
@ApiModelProperty("根据taskId查询累计的任务时长")
|
||||
@GetMapping("/cumulativeQuantity")
|
||||
public R<Integer> cumulativeQuantity(@RequestParam("taskId") Long taskId){
|
||||
return discussService.cumulativeQuantity(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -75,4 +75,9 @@ public interface DiscussService {
|
||||
|
||||
R<PageVO<DiscussDTO>> findDiscussList(DiscussPageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 根据taskId查询累计的任务时长
|
||||
**/
|
||||
R<Integer> cumulativeQuantity(Long taskId);
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -209,4 +209,11 @@ public class DiscussServiceImpl implements DiscussService {
|
||||
return R.success(returnList);
|
||||
}
|
||||
|
||||
public R<Integer> cumulativeQuantity(Long taskId){
|
||||
List<DiscussDO> discussDOList = discussMapper.selectList(DiscussDO::getTaskId, taskId);
|
||||
if (ObjectUtil.isEmpty(discussDOList)){
|
||||
return R.success(0);
|
||||
}
|
||||
return R.success(discussDOList.stream().mapToInt(DiscussDO::getCropNum).sum());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user