yangys
2025-11-27 34428bd30b004336f9ebc93de0ebe8fae65017c9
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
package org.springblade.mdm.commons.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.TaskService;
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.mdm.basesetting.producedivision.entity.MdmUser;
import org.springblade.mdm.basesetting.producedivision.service.MdmUserService;
import org.springblade.mdm.commons.service.ParamService;
import org.springblade.mdm.commons.vo.RemindVO;
import org.springblade.mdm.flow.service.DoneQueryService;
import org.springblade.mdm.flow.service.FlowBusinessService;
import org.springblade.mdm.flow.service.FlowCommonService;
import org.springblade.mdm.flow.service.FlowTransferService;
import org.springblade.mdm.flow.vo.FlowVO;
import org.springblade.mdm.flow.vo.TodoQueryVO;
import org.springblade.mdm.gkw.programnode.vo.ProgramNodeVO;
import org.springblade.mdm.program.service.NcProgramApprovedService;
import org.springblade.mdm.program.vo.NcProgramExportDncPageVO;
import org.springblade.mdm.program.vo.NcProgramExportDncQueryVO;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
 
@Slf4j
@RestController
@RequestMapping("/remind/")
@Tag(name = "任务提醒", description = "任务提醒")
public class RemindController {
 
    @Autowired
    private NcProgramApprovedService ncProgramApprovedService;
    @Autowired
    private FlowBusinessService businessService;
    @Autowired
    private ParamService paramService;
    /**
     * 待办任务列表页
     */
    @GetMapping("task-count")
    @ApiOperationSupport(order = 3)
    @Operation(summary = "待办任务数量查询", description = "待办任务数量查询")
    public R<RemindVO> taskCount() {
        RemindVO result = new RemindVO();
 
        result.setTodoCount(queryTodoCount());
 
        //查询导出的任务数量
        result.setExportCount(queryExportCount());
        return R.data(result);
    }
    long queryTodoCount(){
        TodoQueryVO query = new TodoQueryVO();
        query.setCurrent(1);
        query.setSize(1);
        IPage<FlowVO> pages = businessService.selectTodoPage(Condition.getPage(query), query);
        return pages.getTotal();
    }
    /**
     * 查询导出工控网的数量
     * @return
     */
    long queryExportCount(){
        NcProgramExportDncQueryVO query = new NcProgramExportDncQueryVO();
        query.setCurrent(1);
        query.setSize(1);
        query.setUserId(AuthUtil.getUserId());
        query.setQueryType(NcProgramExportDncQueryVO.TYPE_SELF);
 
        IPage<NcProgramExportDncPageVO> pages = ncProgramApprovedService.exportDncPageQuery(query);
        return pages.getTotal();
    }
}