jiazx0107@163.com
2023-11-04 43ce77a85d8297a53dc25430fff10ead57296167
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
package com.ld.igds.oa.view;
 
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.ld.igds.constant.OrderStatus;
import com.ld.igds.file.CoreFileService;
import com.ld.igds.models.*;
import com.ld.igds.oa.service.HDocumentServiceImpl;
import com.ld.igds.sys.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
 
/**
 * 公文流转管理
 * 
 * @author: chen
 * @date 2023-02-17 16:50
 *
 */
@Component
public class DocumentPR {
 
    @Autowired
    private HDocumentServiceImpl hDocumentService;
    @Autowired
    private CoreFileService fileService;
    @Autowired
    private SysDeptService sysDeptService;
 
    /**
     * 公文流转--任务类型
     *
     * ${dorado.getDataProvider("documentPR#triggerTaskType").getResult()}
     * @return
     */
    @DataProvider
    public List<DicTrigger> triggerTaskType() {
        List<DicTrigger> list = new ArrayList<DicTrigger>();
        list.add(new DicTrigger("10", "普通任务"));
        list.add(new DicTrigger("20", "竞签任务"));
        list.add(new DicTrigger("30", "会签任务"));
        return list;
    }
 
    /*----------公文流转配置----------*/
    /**
     * 获取公文流转信息
     * documentPR#listDocumentNode 查询登录人的工单申请列表
     *
     * @param param
     */
    @DataProvider
    public List<Document> listDocumentNode(Map<String, Object> param) {
        return hDocumentService.listDocumentNode(param);
    }
 
    /**
     * 更新公文信息
     * documentPR#saveDocumentNode
     *
     * @param data
     */
    @DataResolver
    public void saveDocumentNode(DocumentNode data) {
         hDocumentService.saveDocumentNode(data);
    }
 
    /**
     * 删除公文信息
     * documentPR#delDocumentNode
     * @param data
     * @return
     */
    @Expose
    public String delDocumentNode(DocumentNode data) {
        hDocumentService.delDocumentNode(data);
        return null;
    }
 
    /*-----------------公文流转申请相关----------------*/
 
    /**
     * 获取公文流转信息
     * documentPR#listDocument 查询登录人的工单申请列表
     *
     * @param param
     */
    @DataProvider
    public List<Document> listDocument(Map<String, Object> param) {
 
        return hDocumentService.listDocument(param);
    }
 
    /**
     * 更新公文信息
     * documentPR#saveDocument
     *
     * @param data
     */
    @DataResolver
    public void saveDocument(Document data) {
        //保存数据到数据库
        String orderId =  hDocumentService.saveDocument(data);
 
        // 附件
        List<FileInfo> files = data.getFiles();
        fileService.saveFiles(files, orderId,null);
    }
 
    /**
     * 删除公文信息
     * documentPR#delDocument
     * @param data
     * @return
     */
    @Expose
    public String delDocument(Document data) {
 
        return hDocumentService.delDocument(data);
    }
 
    /*-----------------公文流转审核----------------*/
    /**
     * documentPR#listAuditDocument
     *
     * @param param
     */
    @DataProvider
    public List<Document> listAuditDocument(Map<String, Object> param) {
        return hDocumentService.listAuditDocument(param);
    }
 
    /**
     * 审核通过
     * documentPR#passDocument
     *
     * @param data
     * @return
     */
    @Expose
    public void passDocument(Document data) {
        //设置通过状态
        data.setStatus(OrderStatus.Status_20.getCode());
 
 
        hDocumentService.auditApplyOrder(data);
    }
 
    /**
     * 审核拒绝
     * documentPR#rejectDocument
     *
     * @param data
     * @return
     */
    @Expose
    public void rejectDocument(Document data) {
        //设置拒绝状态
        data.setStatus(OrderStatus.Status_30.getCode());
 
        hDocumentService.auditApplyOrder(data);
    }
 
    /**
     * 审核退回
     * documentPR#rejectDocument
     *      *
     * @param data
     * @return
     */
    @Expose
    public void backDocument(Document data) {
        //设置退回状态
        data.setStatus(OrderStatus.Status_40.getCode());
 
        hDocumentService.auditApplyOrder(data);
    }
}