package com.ycl.controller;
|
|
import com.ycl.common.core.domain.R;
|
import com.ycl.common.core.page.TableDataInfo;
|
import com.ycl.domain.vo.*;
|
import com.ycl.service.ProjectInfoService;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Date;
|
import java.util.List;
|
|
/**
|
* 首页
|
*/
|
@RequiredArgsConstructor
|
@RestController
|
@RequestMapping("/")
|
public class IndexController {
|
|
|
@Autowired
|
private ProjectInfoService projectInfoService;
|
|
/**
|
* 项目数量统计
|
*
|
* @param indexDTO 筛选条件
|
* @return
|
*/
|
@PostMapping("/count")
|
public R<IndexCountVO> count(@RequestBody IndexDTO indexDTO) {
|
return R.ok(projectInfoService.getIndexCount(indexDTO));
|
}
|
|
/**
|
* 异常项目统计
|
*
|
* @return
|
*/
|
@GetMapping("/countExceptionProject")
|
public R<?> countExceptionProject(IndexDTO indexDTO) {
|
return R.ok(projectInfoService.countExceptionProject(indexDTO));
|
}
|
|
/**
|
* 审核消息列表
|
*/
|
@GetMapping("/audit-message")
|
public TableDataInfo<Object> auditMessage(PageQuery pageQuery) {
|
return null;
|
}
|
|
/**
|
* 消息条数
|
*/
|
@GetMapping("/message-count")
|
public R<IndexMsgCountVO> messageCount() {
|
IndexMsgCountVO vo = new IndexMsgCountVO();
|
vo.setAuditCount(0L);
|
return R.ok(vo);
|
}
|
|
/**
|
* 阅读消息
|
*/
|
@GetMapping("/read-message")
|
public R<Boolean> readMessage(Long id) {
|
// auditHistoryService.lambdaUpdate().eq(AuditHistory::getId, id).set(AuditHistory::getIsRead, 1).update();
|
return R.ok();
|
}
|
|
/**
|
* 待办流程
|
*/
|
@GetMapping("/getPageByAllTaskWait")
|
public TableDataInfo<TaskVo> getPageByAllTaskWait(TaskBo taskBo, PageQuery pageQuery) {
|
// TableDataInfo<TaskVo> pageByAllTaskWait = actTaskService.getPageByTaskWait(taskBo, pageQuery);
|
// List<TaskVo> rows = pageByAllTaskWait.getRows();
|
// List<String> list = rows.stream().map(TaskVo::getBusinessKey).toList();
|
// if (CollectionUtils.isEmpty(list)) {
|
// return pageByAllTaskWait;
|
// }
|
// projectInfoService.lambdaQuery().in(ProjectInfo::getId, list).list().forEach(projectInfo -> rows.forEach(taskVo -> {
|
// if (ObjectUtil.isNotEmpty(taskVo.getDueDate())) {
|
// taskVo.setRemainingTime(DateTimeUtils.calculateDifference(new Date(), taskVo.getDueDate()));
|
// }
|
// if (ObjectUtil.equals(taskVo.getBusinessKey(), projectInfo.getId().toString())) {
|
// taskVo.setBusinessName(projectInfo.getProjectName());
|
// }
|
// }));
|
// pageByAllTaskWait.setRows(rows);
|
// return pageByAllTaskWait;
|
return null;
|
}
|
}
|