|
@ -1,14 +1,27 @@ |
|
|
package com.yxt.anrui.base.biz.basevehicleactualsales; |
|
|
package com.yxt.anrui.base.biz.basevehicleactualsales; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
|
import cn.hutool.core.convert.Convert; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleUpdateQuery; |
|
|
import com.yxt.anrui.base.api.basevehicleactualdetails.BaseVehicleActualDetails; |
|
|
import com.yxt.anrui.base.api.basevehicleactualdetails.BaseVehicleActualDetails; |
|
|
import com.yxt.anrui.base.api.basevehicleactualdetails.BaseVehicleActualDetailsVo; |
|
|
import com.yxt.anrui.base.api.basevehicleactualdetails.BaseVehicleActualDetailsVo; |
|
|
import com.yxt.anrui.base.api.basevehicleactualsales.*; |
|
|
import com.yxt.anrui.base.api.basevehicleactualsales.*; |
|
|
|
|
|
import com.yxt.anrui.base.biz.basevehicle.BaseVehicleService; |
|
|
import com.yxt.anrui.base.biz.basevehicleactualdetails.BaseVehicleActualDetailsService; |
|
|
import com.yxt.anrui.base.biz.basevehicleactualdetails.BaseVehicleActualDetailsService; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTask; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormLinkFeign; |
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormLinkFeign; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormLinkFlowStateEnum; |
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormStateVo; |
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormStateVo; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcessStateEnum; |
|
|
|
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
@ -22,7 +35,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Author dimengzhe |
|
|
* @Author dimengzhe |
|
@ -41,6 +56,12 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
private SysUserFeign sysUserFeign; |
|
|
private SysUserFeign sysUserFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BaseVehicleService baseVehicleService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FlowableFeign flowableFeign; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 分页列表 |
|
|
* 分页列表 |
|
@ -68,12 +89,24 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
return pv1; |
|
|
return pv1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询分页列表的数据 |
|
|
|
|
|
* |
|
|
|
|
|
* @param pagerQuery 查询条件 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
private IPage<BaseVehicleActualSalesVo> pagerList(PagerQuery<BaseVehicleActualSalesQuery> pagerQuery) { |
|
|
private IPage<BaseVehicleActualSalesVo> pagerList(PagerQuery<BaseVehicleActualSalesQuery> pagerQuery) { |
|
|
IPage<?> page = PagerUtil.queryToPage(pagerQuery); |
|
|
IPage<?> page = PagerUtil.queryToPage(pagerQuery); |
|
|
QueryWrapper<BaseVehicleActualSales> qw = buildQueryWrapper(pagerQuery.getParams()); |
|
|
QueryWrapper<BaseVehicleActualSales> qw = buildQueryWrapper(pagerQuery.getParams()); |
|
|
return baseMapper.pagerList(page, qw); |
|
|
return baseMapper.pagerList(page, qw); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 构造查询条件 |
|
|
|
|
|
* |
|
|
|
|
|
* @param params 查询条件 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
private QueryWrapper<BaseVehicleActualSales> buildQueryWrapper(BaseVehicleActualSalesQuery params) { |
|
|
private QueryWrapper<BaseVehicleActualSales> buildQueryWrapper(BaseVehicleActualSalesQuery params) { |
|
|
QueryWrapper<BaseVehicleActualSales> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<BaseVehicleActualSales> qw = new QueryWrapper<>(); |
|
|
if (params != null) { |
|
|
if (params != null) { |
|
@ -84,6 +117,12 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
return qw; |
|
|
return qw; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 新增或修改未售买断申请 |
|
|
|
|
|
* |
|
|
|
|
|
* @param scmVehicleActualSalesDto 未售买断申请新增或修改数据传输对象 |
|
|
|
|
|
* @return 未售买断申请的sid |
|
|
|
|
|
*/ |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public ResultBean saveOrUpdateVehicleSales(BaseVehicleActualSalesDto scmVehicleActualSalesDto) { |
|
|
public ResultBean saveOrUpdateVehicleSales(BaseVehicleActualSalesDto scmVehicleActualSalesDto) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
@ -121,7 +160,7 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
* 判断是否可删除 |
|
|
* 判断是否可删除 |
|
|
* |
|
|
* |
|
|
* @param sid sid |
|
|
* @param sid sid |
|
|
* @return |
|
|
* @return 是否可以删除true或false |
|
|
*/ |
|
|
*/ |
|
|
private boolean checkCouldChange(String sid) { |
|
|
private boolean checkCouldChange(String sid) { |
|
|
BaseVehicleActualSales baseVehicleActualSales = fetchBySid(sid); |
|
|
BaseVehicleActualSales baseVehicleActualSales = fetchBySid(sid); |
|
@ -136,7 +175,7 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
* 查询用户是否设置了部门 |
|
|
* 查询用户是否设置了部门 |
|
|
* |
|
|
* |
|
|
* @param userSid 用户sid |
|
|
* @param userSid 用户sid |
|
|
* @return |
|
|
* @return 单位sid |
|
|
*/ |
|
|
*/ |
|
|
private String checkUserOrg(String userSid) { |
|
|
private String checkUserOrg(String userSid) { |
|
|
String orgSid = ""; |
|
|
String orgSid = ""; |
|
@ -148,8 +187,83 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
return orgSid; |
|
|
return orgSid; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 提交申请 |
|
|
|
|
|
* |
|
|
|
|
|
* @param baseVehicleActualSalesDto 未售买断新增修改数据传输对象 |
|
|
|
|
|
* @return 未售买断申请的sid |
|
|
|
|
|
*/ |
|
|
public ResultBean submitVehicleSales(BaseVehicleActualSalesDto baseVehicleActualSalesDto) { |
|
|
public ResultBean submitVehicleSales(BaseVehicleActualSalesDto baseVehicleActualSalesDto) { |
|
|
return null; |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
String orgSid = checkUserOrg(baseVehicleActualSalesDto.getUserSid()); |
|
|
|
|
|
if (baseVehicleActualSalesDto.getDetailsList().size() == 0) { |
|
|
|
|
|
return rb.setMsg("请选择未售买断的车辆"); |
|
|
|
|
|
} |
|
|
|
|
|
//保存或修改未售买断申请
|
|
|
|
|
|
ResultBean resultBean = saveOrUpdateVehicleSales(baseVehicleActualSalesDto); |
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
//判断车辆的结算状态是否包含预买断的状态,如果是的话,返回审核失败
|
|
|
|
|
|
boolean isTrue = isTrue(resultBean.getData().toString()); |
|
|
|
|
|
if (isTrue) { |
|
|
|
|
|
return rb.setMsg("提交失败!该申请中包含结算状态已是预买断状态的车辆"); |
|
|
|
|
|
} |
|
|
|
|
|
//开启流程
|
|
|
|
|
|
ResultBean resultBean1 = businessStart(baseVehicleActualSalesDto.getUserSid(), resultBean.getData().toString(), orgSid); |
|
|
|
|
|
if (!resultBean1.getSuccess()) { |
|
|
|
|
|
log.error("开启流程失败"); |
|
|
|
|
|
return rb.setMsg("提交失败"); |
|
|
|
|
|
} |
|
|
|
|
|
return resultBean; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 开启流程 |
|
|
|
|
|
* |
|
|
|
|
|
* @param userSid 用户sid |
|
|
|
|
|
* @param businessSid 业务sid |
|
|
|
|
|
* @param orgSid 单位sid |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public ResultBean businessStart(String userSid, String businessSid, String orgSid) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
|
|
variables.put("orgSid", orgSid); |
|
|
|
|
|
ResultBean businessResultBean = flowableFeign.businessStart(ProcDefEnum.BASEVEHICLEACTUALSALES.getProDefId(), userSid, variables); |
|
|
|
|
|
if (businessResultBean.getSuccess() && businessResultBean.getData() != null) { |
|
|
|
|
|
Map<String, String> map = (Map<String, String>) businessResultBean.getData(); |
|
|
|
|
|
//更新未售买断业务表中的流程状态
|
|
|
|
|
|
modifyFlowState(businessSid, |
|
|
|
|
|
ProcDefEnum.SCMVEHICLERETURN.getProDefId(), |
|
|
|
|
|
map.get("nodeState"), |
|
|
|
|
|
map.get("procInsId"), |
|
|
|
|
|
map.get("taskDefKey") |
|
|
|
|
|
); |
|
|
|
|
|
return rb.success(); |
|
|
|
|
|
} else { |
|
|
|
|
|
return rb.setMsg(businessResultBean.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 更新未售买断业务表中的流程状态 |
|
|
|
|
|
* |
|
|
|
|
|
* @param businessSid 业务sid |
|
|
|
|
|
* @param proDefId 流程定义ID |
|
|
|
|
|
* @param nodeState 节点状态 |
|
|
|
|
|
* @param procInsId 流程实例ID |
|
|
|
|
|
* @param taskDefKey 任务定义的ID值 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void modifyFlowState(String businessSid, String proDefId, String nodeState, |
|
|
|
|
|
String procInsId, |
|
|
|
|
|
String taskDefKey) { |
|
|
|
|
|
baseMapper.modifyFlowState(businessSid, |
|
|
|
|
|
proDefId, |
|
|
|
|
|
nodeState, |
|
|
|
|
|
procInsId, |
|
|
|
|
|
taskDefKey); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -174,4 +288,165 @@ public class BaseVehicleActualSalesService extends MybatisBaseService<BaseVehicl |
|
|
} |
|
|
} |
|
|
return rb.success().setData(vo); |
|
|
return rb.success().setData(vo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 审批同意 |
|
|
|
|
|
* |
|
|
|
|
|
* @param baseVehicleActualSalesFlowQuery 审批相关参数 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public ResultBean complete(BaseVehicleActualSalesFlowQuery baseVehicleActualSalesFlowQuery) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
//查询对象转换为map集合
|
|
|
|
|
|
Map<String, Object> variables = Convert.toMap(String.class, Object.class, baseVehicleActualSalesFlowQuery); |
|
|
|
|
|
BusinessVariables bv = BusinessVariables.builder().build(); |
|
|
|
|
|
bv.setFormVariables(variables); |
|
|
|
|
|
//判断车辆的结算状态是否包含预买断的状态,如果是的话,返回审核失败
|
|
|
|
|
|
boolean isTrue = isTrue(baseVehicleActualSalesFlowQuery.getBusinessSid()); |
|
|
|
|
|
if (isTrue) { |
|
|
|
|
|
return rb.setMsg("审核失败!该申请中包含结算状态已是预买断状态的车辆"); |
|
|
|
|
|
} |
|
|
|
|
|
//审批
|
|
|
|
|
|
ResultBean<FlowTask> resultBean = flowTaskFeign.businessComplete(bv); |
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, Object> map = getMap(variables.get("businessSid").toString(), resultBean.getData()); |
|
|
|
|
|
//更新关联表节点状态属性
|
|
|
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
|
|
if ("Event_end".equals(map.get("taskDefKey"))) { |
|
|
|
|
|
//更新车辆的结算状态
|
|
|
|
|
|
updateByVinNo(variables.get("businessSid").toString()); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取关联表节点状态属性 |
|
|
|
|
|
* |
|
|
|
|
|
* @param businessSid 业务sid |
|
|
|
|
|
* @param flowTask 工作流任务相关参数 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public Map<String, Object> getMap(String businessSid, FlowTask flowTask) { |
|
|
|
|
|
String nodeState = ""; |
|
|
|
|
|
String taskDefKey = ""; |
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
map.put("businessSid", businessSid); |
|
|
|
|
|
if (flowTask != null) { |
|
|
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(flowTask.getProcInsId()); |
|
|
|
|
|
if (listResultBean.getSuccess() && listResultBean.getData().size() != 0) { |
|
|
|
|
|
nodeState = listResultBean.getData().get(0).getName_(); |
|
|
|
|
|
taskDefKey = listResultBean.getData().get(0).getTask_def_key_(); |
|
|
|
|
|
} else { |
|
|
|
|
|
nodeState = ProcessStateEnum.FINISHED.getStateName(); |
|
|
|
|
|
taskDefKey = "Event_end"; |
|
|
|
|
|
map.put("flowState", SysFormLinkFlowStateEnum.FINISH.getCode()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
map.put("nodeState", nodeState); |
|
|
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
|
|
return map; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 批量更新车辆的结算状态为1预买断状态 |
|
|
|
|
|
* |
|
|
|
|
|
* @param businessSid 业务sid |
|
|
|
|
|
*/ |
|
|
|
|
|
public void updateByVinNo(String businessSid) { |
|
|
|
|
|
//更新车辆状态为采购退库中
|
|
|
|
|
|
ResultBean<List<String>> vinNoList = baseVehicleActualDetailsService.selectVinNoList(businessSid); |
|
|
|
|
|
if (vinNoList.getSuccess()) { |
|
|
|
|
|
if (vinNoList.getData().size() != 0) { |
|
|
|
|
|
//结算状态设置为预买断
|
|
|
|
|
|
String settlementStatus = "1"; |
|
|
|
|
|
BaseVehicleUpdateQuery baseVehicleUpdateQuery = new BaseVehicleUpdateQuery(); |
|
|
|
|
|
baseVehicleUpdateQuery.setSettlementStatus(settlementStatus); |
|
|
|
|
|
baseVehicleUpdateQuery.setVinNoLis(vinNoList.getData()); |
|
|
|
|
|
baseVehicleService.updateStatusByVinNo(baseVehicleUpdateQuery); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询车架号数组中是否有结算状态为预买断的车辆,若有则返回true,没有返回false |
|
|
|
|
|
* |
|
|
|
|
|
* @param businessSid 业务sid |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public Boolean isTrue(String businessSid) { |
|
|
|
|
|
boolean isTrue = false; |
|
|
|
|
|
ResultBean<List<String>> vinNoList1 = baseVehicleActualDetailsService.selectVinNoList(businessSid); |
|
|
|
|
|
if (vinNoList1.getSuccess() && vinNoList1.getData().size() != 0) { |
|
|
|
|
|
ResultBean<Boolean> stringResultBean = baseVehicleService.selectStatusByVinNo(vinNoList1.getData()); |
|
|
|
|
|
if (stringResultBean.getSuccess()) { |
|
|
|
|
|
if (stringResultBean.getData()) { |
|
|
|
|
|
isTrue = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return isTrue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean reject(BaseVehicleActualSalesFlowDto dto) { |
|
|
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
|
|
BeanUtil.copyProperties(dto, flowTaskVo); |
|
|
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.taskReject(flowTaskVo); |
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
|
|
return resultBean; |
|
|
|
|
|
} |
|
|
|
|
|
String nodeState = resultBean.getData().get(0).getName_(); |
|
|
|
|
|
String taskDefKey = resultBean.getData().get(0).getTask_def_key_(); |
|
|
|
|
|
String incomingSourceRef = resultBean.getData().get(0).getIncomingSourceRef(); |
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
map.put("businessSid", dto.getBusinessSid()); |
|
|
|
|
|
map.put("nodeState", nodeState); |
|
|
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
|
|
if (incomingSourceRef.contains("start")) { |
|
|
|
|
|
map.put("flowState", SysFormLinkFlowStateEnum.REJECT.getCode()); |
|
|
|
|
|
} |
|
|
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
|
|
return new ResultBean().success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean breakProcess(BaseVehicleActualSalesFlowDto dto) { |
|
|
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
|
|
BeanUtil.copyProperties(dto, flowTaskVo); |
|
|
|
|
|
ResultBean resultBean = flowTaskFeign.breakProcess(flowTaskVo); |
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
|
|
return resultBean; |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
map.put("businessSid", dto.getBusinessSid()); |
|
|
|
|
|
map.put("nodeState", String.valueOf(resultBean.getData())); |
|
|
|
|
|
map.put("taskDefKey", "Event_end"); |
|
|
|
|
|
map.put("flowState", SysFormLinkFlowStateEnum.BREAK.getCode()); |
|
|
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
|
|
return resultBean.success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean revokeProcess(BaseVehicleActualSalesFlowDto dto) { |
|
|
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
|
|
BeanUtil.copyProperties(dto, flowTaskVo); |
|
|
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.revokeProcess(flowTaskVo); |
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
|
|
return resultBean; |
|
|
|
|
|
} |
|
|
|
|
|
String nodeState = resultBean.getData().get(0).getName_(); |
|
|
|
|
|
String taskDefKey = resultBean.getData().get(0).getTask_def_key_(); |
|
|
|
|
|
String inComingSourceRef = resultBean.getData().get(0).getIncomingSourceRef(); |
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
map.put("businessSid", dto.getBusinessSid()); |
|
|
|
|
|
if (inComingSourceRef.contains("start")) { |
|
|
|
|
|
map.put("nodeState", SysFormLinkFlowStateEnum.UNCOMMITTED.getState()); |
|
|
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
|
|
map.put("flowState", SysFormLinkFlowStateEnum.UNCOMMITTED.getCode()); |
|
|
|
|
|
} else { |
|
|
|
|
|
map.put("nodeState", nodeState); |
|
|
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
|
|
} |
|
|
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
|
|
return new ResultBean().success(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|