diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApply.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApply.java index 448bdb66cd..5aa45acf29 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApply.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApply.java @@ -66,5 +66,14 @@ public class ScmVehRebateWithApply extends BaseEntity { private String createOrgSid; // 创建组织sid @ApiModelProperty("创建组织名称") private String createOrgName; // 创建组织名称 - + @ApiModelProperty("流程定义的id") + private String procDefId; + @ApiModelProperty("环节定义的sid") + private String nodeSid; + @ApiModelProperty("流程状态") + private String nodeState; + @ApiModelProperty("流程实例的sid") + private String procInstId; + @ApiModelProperty("任务id") + private String taskId; } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDetailsVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDetailsVo.java index fba8153b54..b04e9d0ec3 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDetailsVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDetailsVo.java @@ -73,6 +73,16 @@ public class ScmVehRebateWithApplyDetailsVo implements Vo { private String createOrgSid; // 创建组织sid @ApiModelProperty("创建组织名称") private String createOrgName; // 创建组织名称 + @ApiModelProperty("流程定义的id") + private String procDefId; + @ApiModelProperty("环节定义的sid") + private String nodeSid; + @ApiModelProperty("流程状态") + private String nodeState; + @ApiModelProperty("流程实例的sid") + private String procInstId; + @ApiModelProperty("任务id") + private String taskId; @ApiModelProperty("单车返利预提列表") private List scmVehRebateWiths; // 单车返利预提列表 } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDto.java index aa524c5d91..da79650848 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDto.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyDto.java @@ -62,6 +62,8 @@ public class ScmVehRebateWithApplyDto implements Dto { private String brandName; // 品牌名称 @ApiModelProperty("预提申请") private String withApply; // 预提申请 + @ApiModelProperty("创建人sid") + private String createBySid; // 创建人sid @ApiModelProperty("创建人姓名") private String createByName; // 创建人姓名 @ApiModelProperty("使用组织sid") @@ -72,6 +74,16 @@ public class ScmVehRebateWithApplyDto implements Dto { private String createOrgSid; // 创建组织sid @ApiModelProperty("创建组织名称") private String createOrgName; // 创建组织名称 + @ApiModelProperty("流程定义的id") + private String procDefId; + @ApiModelProperty("环节定义的sid") + private String nodeSid; + @ApiModelProperty("流程状态") + private String nodeState; + @ApiModelProperty("流程实例的sid") + private String procInstId; + @ApiModelProperty("任务id") + private String taskId; @ApiModelProperty("单车返利预提列表") private List scmVehRebateWiths; // 单车返利预提列表 } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyQuery.java index 2b7401aa95..e115d9be50 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyQuery.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyQuery.java @@ -59,4 +59,6 @@ public class ScmVehRebateWithApplyQuery implements Query { private String createEndTime; // 创建结束日期 @ApiModelProperty("创建组织sid") private String createOrgSid; // 创建组织sid + @ApiModelProperty("流程状态") + private String nodeState; } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyVo.java index b5cbf8e154..6e32976b85 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyVo.java @@ -73,5 +73,6 @@ public class ScmVehRebateWithApplyVo implements Vo { private String createOrgSid; // 创建组织sid @ApiModelProperty("创建组织名称") private String createOrgName; // 创建组织名称 - + @ApiModelProperty("流程状态") + private String nodeState; } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/flow/SubmitScmVehRebateWithApplyDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/flow/SubmitScmVehRebateWithApplyDto.java index 9615e73da1..8082054846 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/flow/SubmitScmVehRebateWithApplyDto.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/flow/SubmitScmVehRebateWithApplyDto.java @@ -1,6 +1,7 @@ package com.yxt.anrui.scm.api.scmvehrebatewithapply.flow; import com.yxt.anrui.scm.api.scmapplyinbound.ScmApplyInboundDto; +import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -10,19 +11,12 @@ import lombok.Data; * @Description */ @Data -public class SubmitScmVehRebateWithApplyDto extends ScmApplyInboundDto { +public class SubmitScmVehRebateWithApplyDto extends ScmVehRebateWithApplyDto { private static final long serialVersionUID = 378585162071125756L; - /*@ApiModelProperty("意见") - private String comment;*/ + @ApiModelProperty("意见") + private String comment; @ApiModelProperty("流程实例id") private String instanceId; @ApiModelProperty("任务id") private String taskId; - /* @ApiModelProperty("业务sid") - private String businessSid; - @ApiModelProperty("流程定义id") - private String modelId; - @ApiModelProperty("下一环节的代办人sid") - private String nextNodeUserSids;*/ - } diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.java index 87fe5e46ae..70dc3c346e 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.java @@ -36,6 +36,7 @@ import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApply; import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyVo; import java.util.List; +import java.util.Map; /** * Project: anrui-scm(单车返利预提申请)
@@ -62,4 +63,6 @@ public interface ScmVehRebateWithApplyMapper extends BaseMapper selectListVo(); + + int updateFlowFiled(Map beanToMap); } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.xml b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.xml index 5e0cae5237..cb8863cb60 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.xml +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyMapper.xml @@ -10,4 +10,19 @@ + + + UPDATE scm_veh_rebate_with_apply + SET nodeState=#{nodeState}, nodeSid=#{taskDefKey} + + , procDefId=#{procDefId} + + + , procInstId=#{procInsId} + + + , taskId=#{taskId} + + WHERE sid=#{sid} + \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java index 2ab6b49c7c..57a305058d 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java @@ -26,9 +26,18 @@ package com.yxt.anrui.scm.biz.scmvehrebatewithapply; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.anrui.flowable.api.flow.FlowableFeign; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; +import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; +import com.yxt.anrui.portal.api.sysuser.SysUserFeign; +import com.yxt.anrui.portal.api.sysuser.SysUserVo; import com.yxt.anrui.scm.api.flow.FlowTaskVo; import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithDetailsVo; import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithDto; @@ -36,6 +45,7 @@ import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.GetNodeQuery; import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.GetNodeVo; import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.SubmitScmVehRebateWithApplyDto; import com.yxt.anrui.scm.biz.scmvehrebatewith.ScmVehRebateWithService; +import com.yxt.common.base.utils.ConstantUtils; import com.yxt.common.core.result.ResultBean; import org.apache.commons.lang3.StringUtils; import com.yxt.common.base.service.MybatisBaseService; @@ -51,8 +61,9 @@ import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Arrays; -import java.util.List; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; /** * Project: anrui-scm(单车返利预提申请)
@@ -72,6 +83,14 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService createQueryWrapper(ScmVehRebateWithApplyQuery query) { // todo: 这里根据具体业务调整查询条件 @@ -101,7 +120,7 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService saveOrUpdateDto(ScmVehRebateWithApplyDto dto) { ResultBean rb = ResultBean.fireFail(); String dtoSid = dto.getSid(); List scmVehRebateWiths = dto.getScmVehRebateWiths(); @@ -114,7 +133,7 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService insertByDto(ScmVehRebateWithApplyDto dto) { ResultBean rb = ResultBean.fireFail(); ScmVehRebateWithApply entity = new ScmVehRebateWithApply(); BeanUtil.copyProperties(dto, entity, "id", "sid"); + entity.setNodeState("待提交"); baseMapper.insert(entity); return rb.success().setData(entity.getSid()); } @@ -179,34 +199,219 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService userVoResultBean = sysUserFeign.fetchBySid(dto.getCreateBySid()); + if (!userVoResultBean.getSuccess()) { + return rb.setMsg(userVoResultBean.getMsg()); + } + //根据staffSid获取用户的组织全路径 + ResultBean orgByStaffSid = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); + if (!orgByStaffSid.getSuccess()) { + return rb.setMsg(orgByStaffSid.getMsg()); + } + //用户的组织全路径 + String orgSidPath = orgByStaffSid.getData().getOrgSidPath(); + ScmVehRebateWithApply scmVehRebateWithApply = fetchBySid(dto.getSid()); + int r = submitBusinessData(dto, scmVehRebateWithApply); + if (r == 3) { + return rb.setMsg("该申请不存在"); + } + if (r == 0) { + return rb.setMsg("操作失败!提交的数据不一致"); + } + //新增修改保存 + ResultBean resultBean = saveOrUpdateDto(dto); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + String businessSid = resultBean.getData(); + //创建BusinessVariables实体对象 + BusinessVariables bv = new BusinessVariables(); + //流程中的参数赋值 + Map variables = BeanUtil.beanToMap(dto); + //若有网关,则赋值网关中判断的字段。 + variables.put("businessSid", businessSid); + //=====================添加app所需参数 + Map appMap = new HashMap<>(); + appMap.put("sid",businessSid); + variables.put("app",appMap); + //用户的部门全路径sid + bv.setOrgSidPath(orgSidPath); + //业务sid + bv.setBusinessSid(businessSid); + //用户sid + bv.setUserSid(dto.getCreateBySid()); + bv.setFormVariables(variables); + //流程定义id + bv.setModelId(ProcDefEnum.SCMVEHREBATEWITHAPPLY.getProDefId()); + if (r == 1) { + ResultBean voResultBean = flowableFeign.startProcess(bv); + UpdateFlowFieldVo ufVo = voResultBean.getData(); + updateFlowFiled(BeanUtil.beanToMap(ufVo)); + return voResultBean; + } + if (r == 2) { + // ToDo:驳回到发起人后再次提交 + if (StringUtils.isBlank(dto.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + bv.setTaskId(scmVehRebateWithApply.getTaskId()); + bv.setTaskDefKey(scmVehRebateWithApply.getNodeSid()); + bv.setComment(StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); + bv.setInstanceId(dto.getInstanceId()); + return complete(bv); + } + return rb; + } + + /** + * 判断提交的流程是否被允许 + * + * @param dto + * @return + */ + private synchronized int submitBusinessData(SubmitScmVehRebateWithApplyDto dto, ScmVehRebateWithApply scmVehRebateWithApply) { + int r = 0; + if (StringUtils.isBlank(dto.getSid())) { + r = 1; + } else { + if (scmVehRebateWithApply != null) { + String businessTaskId = scmVehRebateWithApply.getTaskId(); + if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { + //新提交 + r = 1; + } else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { + //二次提交//只有数据一致的时候才能进行下一步 + r = 2; + } + } else { + r = 3; + } + + } + return r; + } + + private int updateFlowFiled(Map beanToMap) { + return baseMapper.updateFlowFiled(beanToMap); } public ResultBean complete(BusinessVariables bv) { - return null; + ResultBean rb = ResultBean.fireFail(); + ScmVehRebateWithApply scmVehRebateWithApply = fetchBySid(bv.getBusinessSid()); + if (bv.getTaskId().equals(scmVehRebateWithApply.getTaskId())) { + ResultBean resultBean = flowableFeign.handleProsess(bv); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { + } + return rb.success().setData(resultBean.getData()); + } else { + return rb.setMsg("操作失败!提交的数据不一致"); + } } - public ResultBean revokeProcess(FlowTaskVo flowTaskVo) { - return null; + public ResultBean revokeProcess(FlowTaskVo query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + //根据业务sid查询排内购申请 + ScmVehRebateWithApply scmVehRebateWithApply = fetchBySid(query.getBusinessSid()); + String businessTaskId = scmVehRebateWithApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + flowTaskVo.setValues(BeanUtil.beanToMap(scmVehRebateWithApply)); + ResultBean resultBean = flowableFeign.revokeProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + return rb.success().setData(resultBean.getData()); + } + } + return rb.setMsg("操作失败,提交的数据不一致!"); } - public ResultBean taskReject(FlowTaskVo flowTaskVo) { - return null; + public ResultBean taskReject(FlowTaskVo query) { + ResultBean rb = ResultBean.fireFail(); + ScmVehRebateWithApply scmVehRebateWithApply = fetchBySid(query.getBusinessSid()); + if (scmVehRebateWithApply == null) { + return rb.setMsg("该申请不存在"); + } + String businessTaskId = scmVehRebateWithApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.taskReject(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + Map map = BeanUtil.beanToMap(resultBean.getData()); + //更新业务中的流程相关的参数 + updateFlowFiled(map); + return rb.success(); + } + } + return rb.setMsg("操作失败!提交的数据不一致!"); } - public ResultBean breakProcess(FlowTaskVo flowTaskVo) { - return null; + public ResultBean breakProcess(FlowTaskVo query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + ScmVehRebateWithApply scmVehRebateWithApply = fetchBySid(query.getBusinessSid()); + String businessTaskId = scmVehRebateWithApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.breakProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + return rb.success().setData(resultBean.getData()); + } + } + return rb.setMsg("操作失败!提交的数据不一致!"); } public ResultBean flowRecord(String procInsId) { - return null; + return flowTaskFeign.businessFlowRecord(procInsId); } public ResultBean> getNextNodesForSubmit(GetNodeQuery query) { - return null; + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.SCMVEHREBATEWITHAPPLY.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); +// List voList = resultBean.getData().stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); } public ResultBean> getPreviousNodesForReject(GetNodeQuery query) { - return null; + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.SCMVEHREBATEWITHAPPLY.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m),GetNodeVo.class)).collect(Collectors.toList()); +// List voList = resultBean.getData().stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); } } \ No newline at end of file