zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
package com.changhong.epc.tenant.controller.workFlow;
 
import com.changhong.epc.constter.operationLog.OperationLogConst;
import com.changhong.epc.constter.tenant.WorkFlow;
import com.changhong.epc.rely.api.epc.admin.InitCompanyApi;
import com.changhong.epc.rely.api.service.workFlow.WorkFlowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeoutException;
 
@RestController
@Slf4j
public class WorkFlowController implements WorkFlow, OperationLogConst {
    
    @Resource(name="workFlowServiceImpl")
    private WorkFlowService workFlowServicel;
 
    @Resource
    private InitCompanyApi initCompanyApi;
    /**
     * 删除流程定义,批量
     */
    @PostMapping(DEF_DELETE)
    public Map<String, Object> defineDelete(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.defineDelete(maps);
    }
    
    /**
     * 部署流程定义
     */
    @PostMapping(DEF_DEPLOY)
    public Map<String, Object> definePeploy(@RequestBody Map<String,Object> maps) throws TimeoutException{
        maps.remove("tenantID");
        return workFlowServicel.definePeploy(maps);
    }
    
    /**
     * 流程定义分页查询
     */
    @PostMapping(DEF_SEACHE)
    public Map<String, Object> defineSeache(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.defineSeache(maps);
    }
    
    /**
     * 创建流程定义
     * @param processBig
     * @return
     * @throws TimeoutException
     */
    @PostMapping(DEF_CREATE)
    public Map<String, Object> defineCreate(@RequestBody Map<String,Object> map) throws TimeoutException{
        return workFlowServicel.defineCreate(map);
    }
    
    /**
     * 退回流程实例
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_BACK)
    public Map<String, Object> instBack(@RequestBody Map<String,Object> maps) throws TimeoutException{
        Map<String, Object> stringObjectMap = workFlowServicel.instBack(maps);
//        try {
//            log.debug("准备记录日志:---------->");
//            initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),OperationLogConst.OPERATION_RETURN);
//        }catch (Exception e){
//            log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage());
//        }
        return stringObjectMap;
    }
    
    /**
     * 设置代理
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(CREATE_AGENT)
    public Map<String, Object> agentCreat(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.agentCreat(maps);
    }
    
    /**
     * 创建流程实例
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_CREATE)
    public Map<String, Object> instCreat(@RequestBody Map<String,Object> maps) throws TimeoutException{
        Map<String, Object> stringObjectMap = workFlowServicel.instCreat(maps);
//        try {
//            log.debug("准备记录日志:---------->");
//            initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),OperationLogConst.OPERATION_SUBMIT);
//        }catch (Exception e){
//            log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage());
//        }
        return stringObjectMap;
    }
    
    /**
     * 撤销流程实例
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_DRAWBACK)
    public Map<String, Object> instDrawBack(@RequestBody Map<String,Object> maps) throws TimeoutException{
        Map<String, Object> stringObjectMap = workFlowServicel.instDrawBack(maps);
//        try {
//            log.debug("准备记录日志:---------->");
//            initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),Objects.toString(formData.getDataRowNum(),""),OperationLogConst.OPERATION_RECALL);
//        }catch (Exception e){
//            log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage());
//        }
        return stringObjectMap;
    }
    
    /**
     * 结束流程实例
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_OVER)
    public Map<String, Object> instOver(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.instOver(maps);
    }
    
    /**
     * 设置代办
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(CREATE_CHARGE)
    public Map<String, Object> chargeCreate(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.chargeCreate(maps);
    }
    
    /**
     * 执行流程实例
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_FINISH)
    public Map<String, Object> instFinish(@RequestBody Map<String,Object> maps) throws TimeoutException{
        Map<String, Object> stringObjectMap = workFlowServicel.instFinish(maps);
//        try {
//            log.debug("准备记录日志:---------->");
//            initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),OperationLogConst.OPERATION_APPROVE);
//        }catch (Exception e){
//            log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage());
//        }
        return stringObjectMap;
    }
    
    /**
     * 查询流程待办
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(SEACHE_HANDLE)
    public Map<String, Object> instSeacheHandle(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.instSeacheHandle(maps);
    }
    
    /**
     * 流程实例log(参数为空即查询所有)
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_LOG)
    public Map<String, Object> instLog(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.instLog(maps);
    }
    
    /**
     * 获取所有可退回项目
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(GET_BACK)
    public Map<String, Object> getBack(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.getBack(maps);
    }
    
    /**
     * 查询代理(参数为空即查询所有信息)
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_AGENT)
    public Map<String, Object> instAgent(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.instAgent(maps);
    }
    
    /**
     * 查询代理去除流程定义信息
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(AGENT_DEFMSG)
    public Map<String, Object> instAgentDefMsg(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.instAgentDefMsg(maps);
    }
    
    /**
     * 查询流程实例(参数都为空,即查询所有)
     * @param processInst
     * @return
     * @throws TimeoutException
     */
    @PostMapping(INST_SEACHE)
    public Object instSeache(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.instSeache(maps).get("data");
    }
    
    /**
     * 租户注册系统
     */
    @PostMapping(APP_CREATE)
    public Map<String, Object> appCreate(@RequestBody Map<String,Object> maps) throws TimeoutException{
        return workFlowServicel.appCreate(maps);
    }
 
}