20 changed files with 323 additions and 7 deletions
@ -0,0 +1,34 @@ |
|||||
|
package com.yxt.anrui.terminal.api.app; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.app.flowable.AppFlowableRecordQuery; |
||||
|
import com.yxt.anrui.terminal.api.app.flowable.AppFlowableRecordVo; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:15 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Api(tags = "移动端公共") |
||||
|
@FeignClient( |
||||
|
contextId = "terminal-app", |
||||
|
name = "anrui-terminal", |
||||
|
path = "/app/v1/common", |
||||
|
fallback = AppFeignFallback.class) |
||||
|
public interface AppFeign { |
||||
|
|
||||
|
@ApiOperation("手机端-获取车辆移位列表") |
||||
|
@GetMapping("/getProgressList") |
||||
|
@ResponseBody |
||||
|
ResultBean<List<AppFlowableRecordVo>> getProgressList(@SpringQueryMap AppFlowableRecordQuery appFlowableRecordQuery); |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.anrui.terminal.api.app; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:16 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Component |
||||
|
public class AppFeignFallback { |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.anrui.terminal.api.app.flowable; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:35 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppFlowCommentVo implements Vo { |
||||
|
private static final long serialVersionUID = -3500250935249492593L; |
||||
|
@ApiModelProperty(value = "类型") |
||||
|
private String type; |
||||
|
@ApiModelProperty(value = "意见") |
||||
|
private String comment; |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.yxt.anrui.terminal.api.app.flowable; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:40 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppFlowableRecordQuery implements Query { |
||||
|
private static final long serialVersionUID = -1052692071435565128L; |
||||
|
@ApiModelProperty(value = "流程实例id") |
||||
|
@JsonProperty("progressId") |
||||
|
private String procInsId; |
||||
|
|
||||
|
@ApiModelProperty(value = "流程id") |
||||
|
private String deployId; |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.yxt.anrui.terminal.api.app.flowable; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:19 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppFlowableRecordVo implements Vo { |
||||
|
private static final long serialVersionUID = -5672069366532392940L; |
||||
|
|
||||
|
@ApiModelProperty(value = "流程环节名称") |
||||
|
@JsonProperty("progressName") |
||||
|
private String taskName; |
||||
|
@ApiModelProperty(value = "流程状态") |
||||
|
private String stateKey; |
||||
|
|
||||
|
@ApiModelProperty(value = "流程状态value") |
||||
|
private String stateValue; |
||||
|
|
||||
|
@ApiModelProperty(value = "办理时间") |
||||
|
private String time; |
||||
|
@ApiModelProperty(value = "接收时间") |
||||
|
private String createTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "任务耗时") |
||||
|
private String duration; |
||||
|
|
||||
|
@ApiModelProperty(value = "审批意见") |
||||
|
private String content; |
||||
|
@ApiModelProperty(value = "环节的办理人信息") |
||||
|
@JsonProperty("handleBean") |
||||
|
private List<AppUserVo> taskUserInfos; |
||||
|
@ApiModelProperty("任务意见") |
||||
|
@JsonIgnore |
||||
|
private AppFlowCommentVo comment; |
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.anrui.terminal.api.app.flowable; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:24 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppUserVo implements Vo { |
||||
|
private static final long serialVersionUID = -3220584066025636920L; |
||||
|
@ApiModelProperty(value = "名称") |
||||
|
@JsonProperty("name") |
||||
|
private String assigneeName; |
||||
|
@ApiModelProperty(value = "头像") |
||||
|
@JsonProperty("image") |
||||
|
private String assigneeHeadImage; |
||||
|
|
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.scmvehiclegression.flowable; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 10:48 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GressionQuery implements Query { |
||||
|
private static final long serialVersionUID = -668333972696058522L; |
||||
|
@ApiModelProperty(value = "节点key") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
private String businessSid; |
||||
|
@ApiModelProperty(value = "0 上一环节 1下一环节") |
||||
|
@NotNull(message = "参数错误:next") |
||||
|
private Integer next; |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.app; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.app.AppFeign; |
||||
|
import com.yxt.anrui.terminal.api.app.flowable.AppFlowableRecordQuery; |
||||
|
import com.yxt.anrui.terminal.api.app.flowable.AppFlowableRecordVo; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:17 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/app/v1/common") |
||||
|
public class AppRest implements AppFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private AppService appService; |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<AppFlowableRecordVo>> getProgressList(AppFlowableRecordQuery appFlowableRecordQuery) { |
||||
|
return appService.getProgressList(appFlowableRecordQuery); |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.app; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.yxt.anrui.flowable.api.flowtask.FlowRecordVo; |
||||
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
||||
|
import com.yxt.anrui.terminal.api.app.flowable.AppFlowableRecordQuery; |
||||
|
import com.yxt.anrui.terminal.api.app.flowable.AppFlowableRecordVo; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Optional; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/7/28 16:18 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Service |
||||
|
public class AppService { |
||||
|
|
||||
|
@Autowired |
||||
|
private FlowTaskFeign flowTaskFeign; |
||||
|
|
||||
|
public ResultBean<List<AppFlowableRecordVo>> getProgressList(AppFlowableRecordQuery appFlowableRecordQuery) { |
||||
|
ResultBean<List<AppFlowableRecordVo>> rb = ResultBean.fireFail(); |
||||
|
String procInsId = appFlowableRecordQuery.getProcInsId(); |
||||
|
String deployId = appFlowableRecordQuery.getDeployId(); |
||||
|
ResultBean<FlowRecordVo> resultBean = flowTaskFeign.businessFlowRecord(procInsId,deployId); |
||||
|
List<AppFlowableRecordVo> voList = Optional.ofNullable(resultBean.getData().getFlowList()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), AppFlowableRecordVo.class)).collect(Collectors.toList()); |
||||
|
return rb.success().setData(voList); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue