Commit d939b7fc authored by zhangyingbin's avatar zhangyingbin

完善基本流程

parent d27ab565
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@ApiModel(value="ProjectInitiationDto", description="项目立项流程日志表")
public class ProjectInitiationDto extends BaseDto {
@TableField("instance_id")
private String instanceId;
@TableField("task_id")
private String taskId;
@TableField("task_name")
private String taskName;
@TableField("executor")
private String executor;
@TableField("context")
private String context;
}
package com.yeejoin.amos.boot.module.ugp.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_ugp_project_initiation_log")
public class ProjectInitiation extends BaseEntity {
@TableField("instance_id")
private String instanceId;
@TableField("task_id")
private String taskId;
@TableField("task_name")
private String taskName;
@TableField("executor")
private String executor;
@TableField("context")
private String context;
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation;
public interface ProjectInitiationMapper extends BaseMapper<ProjectInitiation> {
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.alibaba.fastjson.JSONObject;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
public interface IProjectInitiationService {
/**
* 流程启动
* @return 返回instanceId ,加入项目信息表中
* @throws Exception
*/
String start();
/**
* 执行流程节点,并记录日志
*/
void execute(String instanceId, Object object, String option);
}
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ResponseHeader;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController @RestController
@Api(tags = "流程相关") @Api(tags = "流程相关")
...@@ -22,7 +23,15 @@ public class ProjectInitiationController { ...@@ -22,7 +23,15 @@ public class ProjectInitiationController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/start") @GetMapping(value = "/start")
@ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动") @ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动")
public void start() throws Exception { public ResponseModel<String> start() throws Exception {
projectInitiationServiceImpl.start(); return ResponseHelper.buildResponse(projectInitiationServiceImpl.start());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/execute/{instanceId}")
@ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动")
public ResponseModel<String> execute(@PathVariable("instanceId")String instanceId, Object object, String option) throws Exception {
projectInitiationServiceImpl.execute(instanceId,object,option);
return ResponseHelper.buildResponse("ok");
} }
} }
...@@ -29,4 +29,4 @@ emqx.password=123456 ...@@ -29,4 +29,4 @@ emqx.password=123456
fire-rescue=123 fire-rescue=123
params.work.flow.processDefinitionKey=ceshi params.work.flow.processDefinitionKey=xiangmulixiangliucheng
\ No newline at end of file \ No newline at end of file
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
<artifactId>amos-boot-biz-common</artifactId> <artifactId>amos-boot-biz-common</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-workflow</artifactId>
<version>1.7.9-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment