Browse Source

工作流通知代码提交

yh 2 years ago
parent
commit
39be5ec6c0

+ 5 - 0
bpm-core/src/main/java/com/srm/bpm/infra/entity/ProcessNodeExtendEntity.java

@@ -51,6 +51,11 @@ public class ProcessNodeExtendEntity extends BaseEntity {
51 51
      * 自动同意规则(1:处理人就是提交人;2:处理人和上一步处理人相同;3处理人审批过;多个已逗号分隔
52 52
      */
53 53
     private String autoAgree;
54
+    
55
+    /**
56
+     * 推送配置(0:邮件;1:站内信;2:流程中心;多个以逗号分隔)
57
+     */
58
+    private String push;
54 59
 
55 60
     /**
56 61
      * 节点显示的按钮

+ 3 - 1
bpm-core/src/main/java/com/srm/bpm/logic/constant/BillTaskStatus.java

@@ -76,7 +76,9 @@ public enum BillTaskStatus {
76 76
     /**
77 77
      * 已移交
78 78
      */
79
-    TURN(15);
79
+    TURN(15),
80
+    
81
+    COMPLATE(16);
80 82
 
81 83
 
82 84
     private final int status;

+ 10 - 2
bpm-core/src/main/java/com/srm/bpm/logic/dto/FlowMsgDTO.java

@@ -32,6 +32,10 @@ public class FlowMsgDTO {
32 32
      */
33 33
     private String content;
34 34
     /**
35
+     * 推送配置(0:邮件;1:站内信;2:流程中心;多个以逗号分隔)
36
+     */
37
+    private String push;
38
+    /**
35 39
      * 节点名称
36 40
      */
37 41
     private String nodeName;
@@ -43,15 +47,19 @@ public class FlowMsgDTO {
43 47
      * 时间
44 48
      */
45 49
     private LocalDateTime time;
46
-
47
-    public static FlowMsgDTO build(String userCode, String createUser, String content, String title, String nodeName, String opinion) {
50
+    
51
+    private Long billId;
52
+    
53
+    public static FlowMsgDTO build(String userCode, String createUser, String content, String title, String push, String nodeName, String opinion, Long billId) {
48 54
         FlowMsgDTO flowMsgDTO = new FlowMsgDTO();
49 55
         flowMsgDTO.setCreateUser(createUser);
50 56
         flowMsgDTO.setUserCode(userCode);
51 57
         flowMsgDTO.setContent(content);
52 58
         flowMsgDTO.setBillTitle(title);
59
+        flowMsgDTO.setPush(push);
53 60
         flowMsgDTO.setNodeName(nodeName);
54 61
         flowMsgDTO.setOpinion(opinion);
62
+        flowMsgDTO.setBillId(billId);
55 63
         flowMsgDTO.setTime(LocalDateTime.now());
56 64
         return flowMsgDTO;
57 65
     }

+ 8 - 0
bpm-core/src/main/java/com/srm/bpm/logic/service/impl/BillLogicImpl.java

@@ -798,6 +798,7 @@ public class BillLogicImpl implements BillLogic {
798 798
                 taskOpt = billBpmnLogic.findTaskBybillAndEmployeeAndTaskId(billId, taskId, userCode);
799 799
                 if (taskOpt.isPresent()) {
800 800
                     BillTaskEntity task = taskOpt.get();
801
+                    task.setOpinion(opinion);
801 802
                     final int taskNodeStatus = task.getNodeStatus();
802 803
                     BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(taskNodeStatus);
803 804
                     switch (billTaskStatus) {
@@ -852,6 +853,13 @@ public class BillLogicImpl implements BillLogic {
852 853
                 if (action.equals(BillAction.refuse.name())) {
853 854
                     callBackLogic.callBack(byId.getProcessId(), billId, BillTaskStatus.REFUSE.getStatus());
854 855
                 } else {
856
+                	BillTaskEntity a = new BillTaskEntity();
857
+                	a.setBillId(byId.getId());
858
+                	a.setUserCode(byId.getSender());
859
+                	a.setNodeStatus(BillTaskStatus.COMPLATE.getStatus());
860
+                	a.setNodeName(byId.getTitle());
861
+                	a.setOpinion("通过");
862
+                	flowMsgLogic.sendMsg(Lists.newArrayList(a));
855 863
                     callBackLogic.callBack(byId.getProcessId(), billId, BillStatus.COMPLETE.getStatus());
856 864
                 }
857 865
             }

+ 203 - 178
bpm-core/src/main/java/com/srm/bpm/logic/service/impl/FlowMsgLogicImpl.java

@@ -1,12 +1,20 @@
1 1
 
2
-
3 2
 package com.srm.bpm.logic.service.impl;
4 3
 
4
+import java.util.List;
5
+import java.util.Optional;
6
+import java.util.Set;
7
+
8
+import org.jetbrains.annotations.NotNull;
9
+import org.springframework.stereotype.Service;
10
+
11
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 12
 import com.google.common.collect.Lists;
6 13
 import com.google.common.collect.Sets;
7
-
8 14
 import com.srm.bpm.infra.entity.BillTaskEntity;
15
+import com.srm.bpm.infra.entity.ProcessNodeExtendEntity;
9 16
 import com.srm.bpm.infra.entity.ToaBillEntity;
17
+import com.srm.bpm.infra.service.ProcessNodeExtendService;
10 18
 import com.srm.bpm.infra.service.ToaBillService;
11 19
 import com.srm.bpm.logic.constant.BillTaskStatus;
12 20
 import com.srm.bpm.logic.constant.BillTaskType;
@@ -15,13 +23,6 @@ import com.srm.bpm.logic.dto.FlowMsgDTO;
15 23
 import com.srm.bpm.logic.service.FlowMsgLogic;
16 24
 import com.srm.bpm.logic.service.PushMsgLogic;
17 25
 
18
-import org.jetbrains.annotations.NotNull;
19
-import org.springframework.stereotype.Service;
20
-
21
-import java.util.List;
22
-import java.util.Optional;
23
-import java.util.Set;
24
-
25 26
 import cn.hutool.core.collection.CollectionUtil;
26 27
 import lombok.RequiredArgsConstructor;
27 28
 import lombok.extern.slf4j.Slf4j;
@@ -37,173 +38,197 @@ import lombok.extern.slf4j.Slf4j;
37 38
 @Service
38 39
 @Slf4j
39 40
 public class FlowMsgLogicImpl implements FlowMsgLogic {
40
-    private final ToaBillService billService;
41
-    private final PushMsgLogic pushMsgLogic;
42
-
43
-    @Override
44
-    public void sendMsg(List<BillTaskEntity> billTaskEntities) {
45
-        if (CollectionUtil.isNotEmpty(billTaskEntities)) {
46
-            final BillTaskEntity billTaskEntity = billTaskEntities.get(0);
47
-            final Long billId = billTaskEntity.getBillId();
48
-            final Optional<ToaBillEntity> billOpt = billService.unique(billId);
49
-            if (billOpt.isPresent()) {
50
-                final ToaBillEntity toaBillEntity = billOpt.get();
51
-                final String title = toaBillEntity.getTitle();
52
-                final String createUserCode = toaBillEntity.getSender();
53
-                final List<FlowMsgDTO> allMsg = Lists.newArrayList();
54
-                for (BillTaskEntity taskEntity : billTaskEntities) {
55
-                    final Integer taskType = taskEntity.getTaskType();
56
-                    final BillTaskType billTaskType = BillTaskType.forValue(taskType);
57
-                    List<FlowMsgDTO> flowMsgDTOS = Lists.newArrayList();
58
-                    switch (billTaskType) {
59
-                        case DEFAULT:
60
-                            flowMsgDTOS = defaultNodeType(taskEntity, createUserCode, title);
61
-                            break;
62
-                        case SKIP:
63
-                            flowMsgDTOS = skipNodeType(taskEntity, createUserCode, title);
64
-                            break;
65
-                        case ENDORSE:
66
-                            flowMsgDTOS = endorseNodeType(taskEntity, createUserCode, title);
67
-                            break;
68
-                        case TRANSFER:
69
-                            flowMsgDTOS = transferNodeType(taskEntity, createUserCode, title);
70
-                            break;
71
-                        case TURN:
72
-                            flowMsgDTOS = turnNodeType(taskEntity, createUserCode, title);
73
-                            break;
74
-                    }
75
-                    allMsg.addAll(flowMsgDTOS);
76
-                }
77
-                log.debug("推送的消息是:{}", allMsg);
78
-//                TODO 注释消息
79
-//                pushMsgLogic.push(allMsg);
80
-            }
81
-        }
82
-    }
83
-
84
-    @Override
85
-    public void sendMsg(List<BillTaskEntity> billTaskEntities, boolean syncFlag) {
86
-        this.sendMsg(billTaskEntities);
87
-    }
88
-
89
-    private List<FlowMsgDTO> turnNodeType(BillTaskEntity taskEntity, String createUser, String title) {
90
-        final Integer nodeStatus = taskEntity.getNodeStatus();
91
-        final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
92
-        Set<String> receivers = Sets.newConcurrentHashSet();
93
-        final String approver = taskEntity.getUserCode();
94
-        final String content = "移交" + getContent(createUser, billTaskStatus, receivers, approver);
95
-        List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
96
-        receivers.forEach(a -> {
97
-            FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, taskEntity.getNodeName(), taskEntity.getOpinion());
98
-            msgDTOS.add(flowMsgDTO);
99
-        });
100
-        return msgDTOS;
101
-    }
102
-
103
-    private List<FlowMsgDTO> transferNodeType(BillTaskEntity taskEntity, String createUser, String title) {
104
-        final Integer nodeStatus = taskEntity.getNodeStatus();
105
-        final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
106
-        Set<String> receivers = Sets.newConcurrentHashSet();
107
-        final String approver = taskEntity.getUserCode();
108
-        final String content = "转办" + getContent(createUser, billTaskStatus, receivers, approver);
109
-        List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
110
-        receivers.forEach(a -> {
111
-            FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, taskEntity.getNodeName(), taskEntity.getOpinion());
112
-            msgDTOS.add(flowMsgDTO);
113
-        });
114
-        return msgDTOS;
115
-    }
116
-
117
-    private List<FlowMsgDTO> endorseNodeType(BillTaskEntity taskEntity, String createUser, String title) {
118
-        final Integer nodeStatus = taskEntity.getNodeStatus();
119
-        final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
120
-        Set<String> receivers = Sets.newConcurrentHashSet();
121
-        final String approver = taskEntity.getUserCode();
122
-        final String content = "加签" + getContent(createUser, billTaskStatus, receivers, approver);
123
-        List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
124
-        receivers.forEach(a -> {
125
-            FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, taskEntity.getNodeName(), taskEntity.getOpinion());
126
-            msgDTOS.add(flowMsgDTO);
127
-        });
128
-        return msgDTOS;
129
-    }
130
-
131
-    private List<FlowMsgDTO> skipNodeType(BillTaskEntity taskEntity, String createUser, String title) {
132
-        final Integer nodeStatus = taskEntity.getNodeStatus();
133
-        final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
134
-        Set<String> receivers = Sets.newConcurrentHashSet();
135
-        final String approver = taskEntity.getUserCode();
136
-        final String content = getContent(createUser, billTaskStatus, receivers, approver);
137
-        List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
138
-        receivers.forEach(a -> {
139
-            if (!a.equals(StringPool.ZERO)) {
140
-                FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, taskEntity.getNodeName(), taskEntity.getOpinion());
141
-                msgDTOS.add(flowMsgDTO);
142
-            }
143
-        });
144
-        return msgDTOS;
145
-    }
146
-
147
-    private List<FlowMsgDTO> defaultNodeType(BillTaskEntity taskEntity, String createUser, String title) {
148
-        final Integer nodeStatus = taskEntity.getNodeStatus();
149
-        final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
150
-        Set<String> receivers = Sets.newConcurrentHashSet();
151
-        final String approver = taskEntity.getUserCode();
152
-        final String content = getContent(createUser, billTaskStatus, receivers, approver);
153
-        List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
154
-        receivers.forEach(a -> {
155
-            FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, taskEntity.getNodeName(), taskEntity.getOpinion());
156
-            msgDTOS.add(flowMsgDTO);
157
-        });
158
-        return msgDTOS;
159
-    }
160
-
161
-    @NotNull
162
-    private String getContent(String createUser, BillTaskStatus billTaskStatus, Set<String> receivers, String approver) {
163
-        final String content;
164
-        switch (billTaskStatus) {
165
-            case APPROVAL:
166
-                content = "审批中";
167
-                receivers.add(approver);
168
-                break;
169
-            case SKIP:
170
-                content = "自动跳过";
171
-                break;
172
-            case ENDORSE:
173
-                content = "加签";
174
-                receivers.add(approver);
175
-                break;
176
-            case AGREE:
177
-                content = "已同意";
178
-                receivers.add(approver);
179
-                receivers.add(createUser);
180
-                break;
181
-            case REFUSE:
182
-                content = "已拒绝";
183
-                receivers.add(approver);
184
-                receivers.add(createUser);
185
-                break;
186
-            case REPULSE:
187
-                content = "已退回";
188
-                receivers.add(approver);
189
-                receivers.add(createUser);
190
-                break;
191
-            case TRANSFER:
192
-                content = "已转办";
193
-                receivers.add(approver);
194
-                break;
195
-            case TURN:
196
-                content = "已移交";
197
-                receivers.add(approver);
198
-                break;
199
-            case REFUSE_FILL_IN:
200
-                content = "重新填写";
201
-                receivers.add(createUser);
202
-                break;
203
-            default:
204
-                content = "";
205
-                break;
206
-        }
207
-        return content;
208
-    }
41
+	private final ToaBillService billService;
42
+	private final PushMsgLogic pushMsgLogic;
43
+	private final ProcessNodeExtendService nodeExtendService;
44
+
45
+	@Override
46
+	public void sendMsg(List<BillTaskEntity> billTaskEntities) {
47
+		if (CollectionUtil.isNotEmpty(billTaskEntities)) {
48
+			final BillTaskEntity billTaskEntity = billTaskEntities.get(0);
49
+			final Long billId = billTaskEntity.getBillId();
50
+
51
+			if (billTaskEntity.getNodeStatus() == BillTaskStatus.COMPLATE.getStatus()) {
52
+				List<FlowMsgDTO> flowMsgDTOS = Lists.newArrayList();
53
+				FlowMsgDTO flowMsgDTO = new FlowMsgDTO();
54
+				flowMsgDTO.setBillTitle(billTaskEntity.getNodeName());
55
+				flowMsgDTO.setBillId(billTaskEntity.getBillId());
56
+				flowMsgDTO.setContent(billTaskEntity.getOpinion());
57
+				flowMsgDTO.setPush("0,1,2");
58
+				flowMsgDTO.setUserCode(billTaskEntity.getUserCode());
59
+				flowMsgDTOS.add(flowMsgDTO);
60
+				pushMsgLogic.push(flowMsgDTOS);
61
+			} else {
62
+				final String taskNodeKey = billTaskEntity.getTaskNodeKey();
63
+				QueryWrapper<ProcessNodeExtendEntity> wrapper = new QueryWrapper<ProcessNodeExtendEntity>();
64
+				wrapper.eq("node_id", taskNodeKey);
65
+				ProcessNodeExtendEntity processNodeExtendEntity = nodeExtendService.getOne(wrapper);
66
+				String push = processNodeExtendEntity.getPush();
67
+				final Optional<ToaBillEntity> billOpt = billService.unique(billId);
68
+				if (billOpt.isPresent()) {
69
+					final ToaBillEntity toaBillEntity = billOpt.get();
70
+					final String title = toaBillEntity.getTitle();
71
+					final String createUserCode = toaBillEntity.getSender();
72
+					final List<FlowMsgDTO> allMsg = Lists.newArrayList();
73
+					for (BillTaskEntity taskEntity : billTaskEntities) {
74
+						final Integer taskType = taskEntity.getTaskType();
75
+						final BillTaskType billTaskType = BillTaskType.forValue(taskType);
76
+						List<FlowMsgDTO> flowMsgDTOS = Lists.newArrayList();
77
+						switch (billTaskType) {
78
+						case DEFAULT:
79
+							flowMsgDTOS = defaultNodeType(taskEntity, createUserCode, title, push);
80
+							break;
81
+						case SKIP:
82
+							flowMsgDTOS = skipNodeType(taskEntity, createUserCode, title, push);
83
+							break;
84
+						case ENDORSE:
85
+							flowMsgDTOS = endorseNodeType(taskEntity, createUserCode, title, push);
86
+							break;
87
+						case TRANSFER:
88
+							flowMsgDTOS = transferNodeType(taskEntity, createUserCode, title, push);
89
+							break;
90
+						case TURN:
91
+							flowMsgDTOS = turnNodeType(taskEntity, createUserCode, title, push);
92
+							break;
93
+						}
94
+						allMsg.addAll(flowMsgDTOS);
95
+					}
96
+					log.debug("推送的消息是:{}", allMsg);
97
+					pushMsgLogic.push(allMsg);
98
+				}
99
+			}
100
+		}
101
+	}
102
+
103
+	@Override
104
+	public void sendMsg(List<BillTaskEntity> billTaskEntities, boolean syncFlag) {
105
+		this.sendMsg(billTaskEntities);
106
+	}
107
+
108
+	private List<FlowMsgDTO> turnNodeType(BillTaskEntity taskEntity, String createUser, String title, String push) {
109
+		final Integer nodeStatus = taskEntity.getNodeStatus();
110
+		final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
111
+		Set<String> receivers = Sets.newConcurrentHashSet();
112
+		final String approver = taskEntity.getUserCode();
113
+		final String content = "移交" + getContent(createUser, billTaskStatus, receivers, approver);
114
+		List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
115
+		receivers.forEach(a -> {
116
+			FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, push, title, taskEntity.getNodeName(),
117
+					taskEntity.getOpinion(), taskEntity.getBillId());
118
+			msgDTOS.add(flowMsgDTO);
119
+		});
120
+		return msgDTOS;
121
+	}
122
+
123
+	private List<FlowMsgDTO> transferNodeType(BillTaskEntity taskEntity, String createUser, String title, String push) {
124
+		final Integer nodeStatus = taskEntity.getNodeStatus();
125
+		final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
126
+		Set<String> receivers = Sets.newConcurrentHashSet();
127
+		final String approver = taskEntity.getUserCode();
128
+		final String content = "转办" + getContent(createUser, billTaskStatus, receivers, approver);
129
+		List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
130
+		receivers.forEach(a -> {
131
+			FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, push, taskEntity.getNodeName(),
132
+					taskEntity.getOpinion(), taskEntity.getBillId());
133
+			msgDTOS.add(flowMsgDTO);
134
+		});
135
+		return msgDTOS;
136
+	}
137
+
138
+	private List<FlowMsgDTO> endorseNodeType(BillTaskEntity taskEntity, String createUser, String title, String push) {
139
+		final Integer nodeStatus = taskEntity.getNodeStatus();
140
+		final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
141
+		Set<String> receivers = Sets.newConcurrentHashSet();
142
+		final String approver = taskEntity.getUserCode();
143
+		final String content = "加签" + getContent(createUser, billTaskStatus, receivers, approver);
144
+		List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
145
+		receivers.forEach(a -> {
146
+			FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, push, taskEntity.getNodeName(),
147
+					taskEntity.getOpinion(), taskEntity.getBillId());
148
+			msgDTOS.add(flowMsgDTO);
149
+		});
150
+		return msgDTOS;
151
+	}
152
+
153
+	private List<FlowMsgDTO> skipNodeType(BillTaskEntity taskEntity, String createUser, String title, String push) {
154
+		final Integer nodeStatus = taskEntity.getNodeStatus();
155
+		final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
156
+		Set<String> receivers = Sets.newConcurrentHashSet();
157
+		final String approver = taskEntity.getUserCode();
158
+		final String content = getContent(createUser, billTaskStatus, receivers, approver);
159
+		List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
160
+		receivers.forEach(a -> {
161
+			if (!a.equals(StringPool.ZERO)) {
162
+				FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, push, taskEntity.getNodeName(),
163
+						taskEntity.getOpinion(), taskEntity.getBillId());
164
+				msgDTOS.add(flowMsgDTO);
165
+			}
166
+		});
167
+		return msgDTOS;
168
+	}
169
+
170
+	private List<FlowMsgDTO> defaultNodeType(BillTaskEntity taskEntity, String createUser, String title, String push) {
171
+		final Integer nodeStatus = taskEntity.getNodeStatus();
172
+		final BillTaskStatus billTaskStatus = BillTaskStatus.valueTo(nodeStatus);
173
+		Set<String> receivers = Sets.newConcurrentHashSet();
174
+		final String approver = taskEntity.getUserCode();
175
+		final String content = getContent(createUser, billTaskStatus, receivers, approver);
176
+		List<FlowMsgDTO> msgDTOS = Lists.newArrayListWithExpectedSize(receivers.size());
177
+		receivers.forEach(a -> {
178
+			FlowMsgDTO flowMsgDTO = FlowMsgDTO.build(a, createUser, content, title, push, taskEntity.getNodeName(),
179
+					taskEntity.getOpinion(), taskEntity.getBillId());
180
+			msgDTOS.add(flowMsgDTO);
181
+		});
182
+		return msgDTOS;
183
+	}
184
+
185
+	@NotNull
186
+	private String getContent(String createUser, BillTaskStatus billTaskStatus, Set<String> receivers,
187
+			String approver) {
188
+		final String content;
189
+		switch (billTaskStatus) {
190
+		case APPROVAL:
191
+			content = "审批中";
192
+			receivers.add(approver);
193
+			break;
194
+		case SKIP:
195
+			content = "自动跳过";
196
+			break;
197
+		case ENDORSE:
198
+			content = "加签";
199
+			receivers.add(approver);
200
+			break;
201
+		case AGREE:
202
+			content = "已同意";
203
+			receivers.add(approver);
204
+			//receivers.add(createUser);
205
+			break;
206
+		case REFUSE:
207
+			content = "已拒绝";
208
+			//receivers.add(approver);
209
+			receivers.add(createUser);
210
+			break;
211
+		case REPULSE:
212
+			content = "已退回";
213
+			receivers.add(approver);
214
+			receivers.add(createUser);
215
+			break;
216
+		case TRANSFER:
217
+			content = "已转办";
218
+			receivers.add(approver);
219
+			break;
220
+		case TURN:
221
+			content = "已移交";
222
+			receivers.add(approver);
223
+			break;
224
+		case REFUSE_FILL_IN:
225
+			content = "重新填写";
226
+			receivers.add(createUser);
227
+			break;
228
+		default:
229
+			content = "";
230
+			break;
231
+		}
232
+		return content;
233
+	}
209 234
 }

+ 1 - 0
bpm-core/src/main/java/com/srm/bpm/logic/service/impl/ProcessDesingerLogicImpl.java

@@ -207,6 +207,7 @@ public class ProcessDesingerLogicImpl implements ProcessDesingerLogic {
207 207
             nodeExtend.setId(nodeExtendId);
208 208
             nodeExtend.setNodeId(nodeId);
209 209
             nodeExtend.setBtns(nodeSetting.getBtns());
210
+            nodeExtend.setPush(nodeSetting.getPush());
210 211
             nodeExtend.setNodeType(nodeSetting.getNtype());
211 212
             nodeExtend.setNodeName(nodeSetting.getTitle());
212 213
             nodeExtend.setAutoAgree(nodeSetting.getAutoAgree());

+ 1 - 0
bpm-core/src/main/java/com/srm/bpm/logic/vo/ProcessNodeVO.java

@@ -43,6 +43,7 @@ public class ProcessNodeVO implements Serializable {
43 43
     private String title;
44 44
     private BigDecimal autoNextHours;
45 45
     private String autoAgree;
46
+    private String push;
46 47
     private String btns;
47 48
     private Integer countersignFlag;
48 49
     private Integer batchApproval;

+ 69 - 1
bpm-core/src/main/resources/static/designer/app/design/flow-node-setting/panel/task.js

@@ -41,7 +41,8 @@ define(function (require, exports, module) {
41 41
                 "autoAgreeTitle",
42 42
                 "noApprovalOperationTitle",
43 43
                 "autoNextHoursTitle",
44
-                "selectApprovalTitle"];
44
+                "selectApprovalTitle",
45
+                "pushTitle"];
45 46
             var linkType = this.getNodeSettingByName('linkType');
46 47
             if (Foundation.isEmpty(linkType)) {
47 48
                 linkType = 'create';
@@ -297,6 +298,12 @@ define(function (require, exports, module) {
297 298
                         }]
298 299
                     ]
299 300
                 },
301
+                {
302
+                    xtype: 'title',
303
+                    title: "推送配置",
304
+                    id: "pushTitle",
305
+                },
306
+                this.__getpushConfig(),
300 307
                 "-",
301 308
                 {
302 309
                     xtype: 'title',
@@ -447,6 +454,67 @@ define(function (require, exports, module) {
447 454
                 ]
448 455
             }
449 456
         },
457
+         //推送配置
458
+        __getpushConfig: function () {
459
+            var self = this;
460
+            var tmpValue = self.getNodeSettingByName('push') + "";
461
+            var email = false;	// 邮件
462
+            var msg = false;	// 站内信
463
+            var app = false;	// 小程序
464
+            if (!Foundation.isEmpty(tmpValue)) {
465
+                var options = tmpValue.split(",");
466
+                email = options.indexOf("0") != -1
467
+                msg = options.indexOf("1") != -1
468
+                app = options.indexOf("2") != -1
469
+            }
470
+
471
+            function stateChange(selected, r) {
472
+                var tmpValue = self.getNodeSettingByName('push');
473
+                if (Foundation.isEmpty(tmpValue) || tmpValue == "undefined") {
474
+                    if (selected) {
475
+                        self.setNodeSetting('push', r);
476
+                    }
477
+                } else {
478
+                    var options = tmpValue.split(",");
479
+                    if (selected) {
480
+                        options.push(r);
481
+                    } else {
482
+                        Foundation.Array.remove(options, r);
483
+                    }
484
+                    self.setNodeSetting('push', options.join(","));
485
+                }
486
+            }
487
+
488
+            return {
489
+                xtype: "tablecontainer",
490
+                rowSize: ["auto","auto","auto"],
491
+                colSize: ["auto"],
492
+                items: [
493
+                    [{
494
+                        xtype: 'checkbox',
495
+                        text: '推送邮件',
496
+                        value: email,
497
+                        onStateChange: (selected) => {
498
+                            stateChange(selected, "0");
499
+                        }
500
+                    }], [{
501
+                        xtype: 'checkbox',
502
+                        text: '推送站内信',
503
+                        value: msg,
504
+                        onStateChange: (selected) => {
505
+                            stateChange(selected, "1");
506
+                        }
507
+                    }], [{
508
+                        xtype: 'checkbox',
509
+                        text: '推送流程中心',
510
+                        value: app,
511
+                        onStateChange: (selected) => {
512
+                            stateChange(selected, "2");
513
+                        }
514
+                    }]
515
+                ]
516
+            }
517
+        },
450 518
         // 弹出节点抄送人配置
451 519
         __getProcessCcBoxConfig: function () {
452 520
             var self = this;

+ 1 - 1
bpm-server/src/main/resources/application-dev.yml

@@ -4,7 +4,7 @@ bpm:
4 4
   target-url: http://127.0.0.1:8778
5 5
   type: 1
6 6
   callback-url: http://127.0.0.1:8778/bill/rest/callback
7
-  pushmsg-url: http://127.0.0.1:8778/bill/rest/pushmsg
7
+  pushmsg-url: http://127.0.0.1:8778/task/pushmsg
8 8
 spring:
9 9
   jackson:
10 10
     time-zone: GMT+8

+ 1 - 1
bpm-server/src/main/resources/application-prod.yml

@@ -4,7 +4,7 @@ bpm:
4 4
   target-url: http://127.0.0.1:9888
5 5
   type: 1
6 6
   callback-url: http://127.0.0.1:9888/bill/rest/callback
7
-  pushmsg-url: http://127.0.0.1:9888/bill/rest/pushmsg
7
+  pushmsg-url: http://127.0.0.1:9888/task/pushmsg
8 8
 spring:
9 9
   jackson:
10 10
     time-zone: GMT+8

+ 1 - 1
bpm-server/src/main/resources/application-test.yml

@@ -4,7 +4,7 @@ bpm:
4 4
   target-url: http://172.16.0.71:8778
5 5
   type: 1
6 6
   callback-url: http://127.0.0.1:8778/bill/rest/callback
7
-  pushmsg-url: http://127.0.0.1:8778/bill/rest/pushmsg
7
+  pushmsg-url: http://127.0.0.1:8778/task/pushmsg
8 8
 spring:
9 9
   jackson:
10 10
     time-zone: GMT+8