|
@@ -15,11 +15,11 @@ import com.dingding.mid.dto.json.UserInfo;
|
|
|
import com.dingding.mid.entity.Cc;
|
|
|
import com.dingding.mid.entity.ProcessTemplates;
|
|
|
import com.dingding.mid.entity.Users;
|
|
|
+import com.dingding.mid.entity.WorkflowConfig;
|
|
|
import com.dingding.mid.enums.RefuseEnums;
|
|
|
import com.dingding.mid.exception.WorkFlowException;
|
|
|
-import com.dingding.mid.service.CcService;
|
|
|
-import com.dingding.mid.service.ProcessTemplateService;
|
|
|
-import com.dingding.mid.service.UserService;
|
|
|
+import com.dingding.mid.mqtt.WorkFlowMessage;
|
|
|
+import com.dingding.mid.service.*;
|
|
|
import com.dingding.mid.utils.MinioUploadUtil;
|
|
|
import com.dingding.mid.utils.SpringContextHolder;
|
|
|
import com.dingding.mid.vo.*;
|
|
@@ -32,10 +32,12 @@ import io.minio.http.Method;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.flowable.bpmn.model.BpmnModel;
|
|
|
import org.flowable.bpmn.model.FlowElement;
|
|
|
import org.flowable.bpmn.model.Process;
|
|
|
+import org.flowable.bpmn.model.ServiceTask;
|
|
|
import org.flowable.common.engine.impl.identity.Authentication;
|
|
|
import org.flowable.engine.HistoryService;
|
|
|
import org.flowable.engine.RepositoryService;
|
|
@@ -79,6 +81,7 @@ import static com.dingding.mid.utils.BpmnModelUtils.getChildNodeByNodeId;
|
|
|
@RequestMapping("/workspace")
|
|
|
@Api(tags = {"Vue2版本 的数据列表,待办,已办,我发起等接口"})
|
|
|
@ApiSort(3)
|
|
|
+@Slf4j
|
|
|
public class WorkspaceProcessController {
|
|
|
|
|
|
@Resource
|
|
@@ -96,6 +99,12 @@ public class WorkspaceProcessController {
|
|
|
@Resource
|
|
|
private CcService ccService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private SendMessageService sendMessageService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private WorkflowConfigService workflowConfigService;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -613,6 +622,33 @@ public class WorkspaceProcessController {
|
|
|
runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()).moveActivityIdTo(task.getTaskDefinitionKey(),target).changeState();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ String processInstanceId = handleDataDTO.getProcessInstanceId();
|
|
|
+
|
|
|
+ HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId)
|
|
|
+ .includeProcessVariables().singleResult();
|
|
|
+ String processDefinitionKey = historicProcessInstance.getProcessDefinitionKey();
|
|
|
+ ProcessTemplates processTemplates = processTemplateService.getById(processDefinitionKey.replace(PROCESS_PREFIX, ""));
|
|
|
+ String tableConfigId = processTemplates.getTableConfigId();
|
|
|
+ log.info("tableConfigId:{}", tableConfigId);
|
|
|
+ if (tableConfigId != null) {
|
|
|
+ //根据tableConfigId 查询需要修改的表单
|
|
|
+ WorkflowConfig workflowConfig = workflowConfigService.getById(tableConfigId);
|
|
|
+ //获取表名
|
|
|
+ String tableName = workflowConfig.getTableName();
|
|
|
+ //MQTT
|
|
|
+ String command = "UPDATE-STATE-REFUSE";
|
|
|
+ WorkFlowMessage workFlowMessage = new WorkFlowMessage().setTableName(tableName).setProcessInstanceId(processInstanceId).setCommand(command);
|
|
|
+ //发送表名和实例id
|
|
|
+ String topic = "workflow/park/company";
|
|
|
+ boolean publish = sendMessageService.publish(topic, workFlowMessage);
|
|
|
+ if (publish) {
|
|
|
+ log.info("发送成功");
|
|
|
+ } else {
|
|
|
+ log.info("发送失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return Result.OK();
|
|
|
}
|
|
|
|