xiangpei
2025-02-11 d0b275ac9b4b071359356edf238e7d0c9114dbd1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.ycl.controller;
 
import com.ycl.common.core.controller.BaseController;
import com.ycl.common.core.domain.R;
import com.ycl.common.core.page.TableDataInfo;
import com.ycl.domain.entity.AuditHistory;
import com.ycl.domain.vo.*;
import com.ycl.service.AuditHistoryService;
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 extends BaseController {
 
 
    @Autowired
    private ProjectInfoService projectInfoService;
 
 
    @Autowired
    private AuditHistoryService auditHistoryService;
 
    /**
     * 项目数量统计
     *
     * @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) {
        AuditHistory auditHistory = new AuditHistory();
        auditHistory.setTaskId("001");
        auditHistory.setTaskDefinitionKey("key");
        auditHistory.setViewer("张三");
        auditHistory.setCommitDept("部门1");
        auditHistory.setAuditType("01");
        auditHistory.setIsRead("0");
        auditHistory.setBusinessKey("12");
        auditHistory.setBusinessTable("t_plan");
        auditHistory.setContent("消息回复");
//        auditHistoryService.save(auditHistory);
        return getDataTable(auditHistoryService.list());
    }
 
    /**
     * 消息条数
     */
    @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;
    }
}