|
|
@ -40,13 +40,20 @@ import com.yxt.anrui.buscenter.api.busdepositvehicle.BusDepositVehicle; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositvehiclecustomer.BusDepositVehicleCustomer; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositvehiclecustomer.BusDepositVehicleCustomerVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busmaindeposit.*; |
|
|
|
import com.yxt.anrui.buscenter.api.flow.FlowTaskVo; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdeposit.BusDepositService; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdepositcustomer.BusDepositCustomerService; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdepositvehicle.BusDepositVehicleService; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdepositvehiclecustomer.BusDepositVehicleCustomerService; |
|
|
|
import com.yxt.anrui.buscenter.biz.flow.FlowableService; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.AppCrmCustomerTempInfoVo; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.sysformlink.*; |
|
|
|
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.dictcommon.DictCommonFeign; |
|
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
@ -61,6 +68,7 @@ import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import io.swagger.annotations.ApiModelProperty; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -109,6 +117,10 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
@Autowired |
|
|
|
private BusDepositCustomerService busDepositCustomerService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CrmCustomerTempFeign crmCustomerTempFeign; |
|
|
|
@Autowired |
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleFeign baseVehicleFeign; |
|
|
|
|
|
|
@ -580,6 +592,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
if (flowState == 0 || flowState == -1) { |
|
|
|
record.setShowUpdateBtn(true); |
|
|
|
record.setShowDeleteBtn(true); |
|
|
|
record.setShowDonwnLoadBtn(true); |
|
|
|
} |
|
|
|
} else { |
|
|
|
record.setShowUpdateBtn(true); |
|
|
@ -647,7 +660,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDeposit.setPaymentProof(parsePaymentProofList(dto.getPayImages())); |
|
|
|
busDepositService.insert(busDeposit); |
|
|
|
//添加客户信息
|
|
|
|
appSetBusDepositCustomer(dto, busDeposit); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("添加成功"); |
|
|
|
} else { //修改
|
|
|
|
Integer flowState = sysFormLinkFeign.selectStateByBusinessSid(dto.getVirtualOrderSid()).getData().getFlowState(); |
|
|
@ -659,7 +672,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
setBusDeposit(busDeposit, dto); |
|
|
|
busDepositService.updateById(busDeposit); |
|
|
|
busDepositCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setMsg("修改成功"); |
|
|
|
} |
|
|
|
return new ResultBean().fail().setMsg("已提交办理审批中不可修改!"); |
|
|
@ -677,7 +690,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDeposit.setDraweeName(dto.getPayName()); |
|
|
|
busDeposit.setProBankAcc(dto.getCollectionNumber()); |
|
|
|
busDeposit.setPayTypeKey(dto.getPayTypeKey()); |
|
|
|
busDeposit.setPayType(dto.getPayTypeValue()); |
|
|
|
busDeposit.setPayType(dto.getPayType()); |
|
|
|
busDeposit.setPaymentDate(dto.getPayDate()); |
|
|
|
busDeposit.setVehicleNum(dto.getCarNumber()); |
|
|
|
busDeposit.setDraweeMobile(dto.getMobile()); |
|
|
@ -690,16 +703,16 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* 新增/修改虚拟订单订金收取添加客户信息方法 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @param busDeposit |
|
|
|
* @param billSid |
|
|
|
*/ |
|
|
|
public void appSetBusDepositCustomer(AppBusDepositBuscenterDto dto, BusDeposit busDeposit) { |
|
|
|
public void appSetBusDepositCustomer(AppBusDepositBuscenterDto dto, String billSid) { |
|
|
|
for (AppBusDepositCustomerListDto appBusDepositCustomerListDto : dto.getCustomerList()) { |
|
|
|
BusDepositCustomer busDepositCustomer = new BusDepositCustomer(); |
|
|
|
busDepositCustomer.setSid(UUID.randomUUID().toString()); |
|
|
|
busDepositCustomer.setCustomerSid(appBusDepositCustomerListDto.getCustomerSid()); |
|
|
|
busDepositCustomer.setCustomerMobile(appBusDepositCustomerListDto.getMobile()); |
|
|
|
busDepositCustomer.setCustomerName(appBusDepositCustomerListDto.getCustomerName()); |
|
|
|
busDepositCustomer.setBillSid(busDeposit.getBillSid()); |
|
|
|
busDepositCustomer.setBillSid(billSid); |
|
|
|
busDepositCustomerService.insert(busDepositCustomer); |
|
|
|
} |
|
|
|
} |
|
|
@ -919,6 +932,63 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
return new ResultBean().success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* APP重新提交虚拟订单审批(订金)流程 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean reSubmitAppMainDespoitApprove(AppBusDepositBuscenterDto dto) { |
|
|
|
|
|
|
|
String businessSid = ""; |
|
|
|
if (StringUtils.isBlank(dto.getUserSid())) { |
|
|
|
return new ResultBean().fail().setMsg("用户sid不能为空"); |
|
|
|
} |
|
|
|
// 验证
|
|
|
|
if (StringUtils.isBlank(dto.getVirtualOrderSid())) { |
|
|
|
// 调用保存/修改接口
|
|
|
|
ResultBean resultBean = saveDepositInfo(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean.setMsg("提交失败"); |
|
|
|
} |
|
|
|
businessSid = resultBean.getData().toString(); |
|
|
|
} else { |
|
|
|
businessSid = dto.getVirtualOrderSid(); |
|
|
|
} |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("taskId", dto.getTaskId()); |
|
|
|
variables.put("procInsId", dto.getProcInsId()); |
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
variables.put("userSid", dto.getUserSid()); |
|
|
|
BusinessVariables bv = BusinessVariables.builder().build(); |
|
|
|
bv.setDetailUrl(""); |
|
|
|
bv.setHandleUrl(""); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowTask> resultBean = flowTaskFeign.businessComplete(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = ""; |
|
|
|
String taskDefKey = ""; |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", variables.get("businessSid").toString()); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(resultBean.getData().getProcInsId()); |
|
|
|
if (listResultBean.getSuccess() && listResultBean.getData() != null && 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"; |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.FINISH.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* APP提交虚拟订单审批(预定车辆)流程 |
|
|
|
* |
|
|
@ -978,9 +1048,14 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
baseMapper.insert(busMainDeposit); |
|
|
|
// 车辆客户信息
|
|
|
|
BusDepositVehicleCustomer customer = new BusDepositVehicleCustomer(); |
|
|
|
customer.setCustomerSid(dto.getCustomerSid()); |
|
|
|
customer.setCustomerName(dto.getCusmoterName()); |
|
|
|
customer.setCustomerMobile(dto.getMobile()); |
|
|
|
String customerSid = dto.getCustomerSid(); |
|
|
|
AppCrmCustomerTempInfoVo appCrmCustomerTempInfoVo = crmCustomerTempFeign.getAppCustomerTempDetailsBySid(customerSid).getData(); |
|
|
|
customer.setCustomerSid(customerSid); |
|
|
|
customer.setCustomerName(appCrmCustomerTempInfoVo.getName()); |
|
|
|
customer.setCustomerMobile(appCrmCustomerTempInfoVo.getMobile()); |
|
|
|
customer.setCustomerClass(appCrmCustomerTempInfoVo.getCustomerType()); |
|
|
|
customer.setCustomerClassKey(appCrmCustomerTempInfoVo.getCustomerTypeKey()); |
|
|
|
customer.setCustomerPhoto(appCrmCustomerTempInfoVo.getCustomerPhoto()); |
|
|
|
customer.setSid(UUID.randomUUID().toString()); |
|
|
|
customer.setBillSid(busMainDeposit.getSid()); |
|
|
|
busDepositVehicleCustomerService.save(customer); |
|
|
@ -1010,11 +1085,357 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDepositVehicle.setRemarks(carListDto.getRemarks()); |
|
|
|
busDepositVehicle.setReserve_deposit_date(carListDto.getDepositDate()); |
|
|
|
busDepositVehicle.setReserve_position(carListDto.getLocation()); |
|
|
|
busDepositVehicle.setReserve_price(carListDto.getPirce()); |
|
|
|
busDepositVehicle.setReserve_price(carListDto.getPrice()); |
|
|
|
busDepositVehicle.setModelConfigSid(carListDto.getConfigSid()); |
|
|
|
busDepositVehicle.setModelSid(carListDto.getModelSid()); |
|
|
|
busDepositVehicle.setVehicleSid(carListDto.getCarSid()); |
|
|
|
busDepositVehicleService.insert(busDepositVehicle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public BusMainDeposit selBusMainDepositBySid(String virtualOrderSid) { |
|
|
|
return baseMapper.selBusMainDepositBySid(virtualOrderSid); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订金办理同意 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean agreeDeposit(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("taskId", appBusMainDepositFlowTask.getTaskId()); |
|
|
|
variables.put("procInsId", appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
variables.put("comment", appBusMainDepositFlowTask.getComment()); |
|
|
|
variables.put("businessSid", appBusMainDepositFlowTask.getBusinessSid()); |
|
|
|
variables.put("userSid", appBusMainDepositFlowTask.getUserSid()); |
|
|
|
BusinessVariables bv = BusinessVariables.builder().build(); |
|
|
|
bv.setDetailUrl(""); |
|
|
|
bv.setHandleUrl(""); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowTask> resultBean = flowTaskFeign.businessComplete(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = ""; |
|
|
|
String taskDefKey = ""; |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", variables.get("businessSid").toString()); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(resultBean.getData().getProcInsId()); |
|
|
|
if (listResultBean.getSuccess() && listResultBean.getData() != null && 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"; |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.FINISH.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订金撤回 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean recallDeposit(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
String userSid = appBusMainDepositFlowTask.getUserSid(); |
|
|
|
String businessSid = appBusMainDepositFlowTask.getBusinessSid(); |
|
|
|
fl.setTaskId(appBusMainDepositFlowTask.getTaskId()); |
|
|
|
fl.setInstanceId(appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
fl.setComment(appBusMainDepositFlowTask.getComment()); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.revokeProcess(fl); |
|
|
|
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> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
if (incomingSourceRef.contains("start")) { |
|
|
|
paramMap.put("nodeState", SysFormLinkFlowStateEnum.UNCOMMITTED.getState()); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.UNCOMMITTED.getCode()); |
|
|
|
} else { |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
} |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订金驳回 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean rejectDeposit(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
String userSid = appBusMainDepositFlowTask.getUserSid(); |
|
|
|
String businessSid = appBusMainDepositFlowTask.getBusinessSid(); |
|
|
|
fl.setTaskId(appBusMainDepositFlowTask.getTaskId()); |
|
|
|
fl.setInstanceId(appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
fl.setComment(appBusMainDepositFlowTask.getComment()); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.taskReject(fl); |
|
|
|
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> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
if (incomingSourceRef.contains("start")) { |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.REJECT.getCode()); |
|
|
|
} |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订金终止流程 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean stopDeposit(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
String userSid = appBusMainDepositFlowTask.getUserSid(); |
|
|
|
String businessSid = appBusMainDepositFlowTask.getBusinessSid(); |
|
|
|
fl.setTaskId(appBusMainDepositFlowTask.getTaskId()); |
|
|
|
fl.setInstanceId(appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
fl.setComment(appBusMainDepositFlowTask.getComment()); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean resultBean = flowTaskFeign.breakProcess(fl); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("nodeState", String.valueOf(resultBean.getData())); |
|
|
|
paramMap.put("taskDefKey", "Event_end"); |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.BREAK.getCode()); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新流程相关的状态 |
|
|
|
* |
|
|
|
* @param map |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private int updateFlowFiled(Map<String, Object> map) { |
|
|
|
return baseMapper.updateFlowFiled(map); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean reSubmitAppMainDespoitVehicleApprove(AppBusDepositVehicleDto dto) { |
|
|
|
String businessSid = ""; |
|
|
|
if (StringUtils.isBlank(dto.getUserSid())) { |
|
|
|
return new ResultBean().fail().setMsg("用户sid"); |
|
|
|
} |
|
|
|
// 验证
|
|
|
|
if (StringUtils.isBlank(dto.getVirtualOrderSid())) { |
|
|
|
// 调用保存/修改接口
|
|
|
|
ResultBean resultBean = reserveCarInfo(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean.setMsg("提交失败"); |
|
|
|
} |
|
|
|
businessSid = resultBean.getData().toString(); |
|
|
|
} else { |
|
|
|
businessSid = dto.getVirtualOrderSid(); |
|
|
|
} |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("taskId", dto.getTaskId()); |
|
|
|
variables.put("procInsId", dto.getProcInsId()); |
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
variables.put("userSid", dto.getUserSid()); |
|
|
|
BusinessVariables bv = BusinessVariables.builder().build(); |
|
|
|
bv.setDetailUrl(""); |
|
|
|
bv.setHandleUrl(""); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowTask> resultBean = flowTaskFeign.businessComplete(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = ""; |
|
|
|
String taskDefKey = ""; |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", variables.get("businessSid").toString()); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(resultBean.getData().getProcInsId()); |
|
|
|
if (listResultBean.getSuccess() && listResultBean.getData() != null && 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"; |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.FINISH.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 预定车辆同意办理 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean agreeReserveCar(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("taskId", appBusMainDepositFlowTask.getTaskId()); |
|
|
|
variables.put("procInsId", appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
variables.put("comment", appBusMainDepositFlowTask.getComment()); |
|
|
|
variables.put("businessSid", appBusMainDepositFlowTask.getBusinessSid()); |
|
|
|
variables.put("userSid", appBusMainDepositFlowTask.getUserSid()); |
|
|
|
BusinessVariables bv = BusinessVariables.builder().build(); |
|
|
|
bv.setDetailUrl(""); |
|
|
|
bv.setHandleUrl(""); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowTask> resultBean = flowTaskFeign.businessComplete(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = ""; |
|
|
|
String taskDefKey = ""; |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", variables.get("businessSid").toString()); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(resultBean.getData().getProcInsId()); |
|
|
|
if (listResultBean.getSuccess() && listResultBean.getData() != null && 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"; |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.FINISH.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 预定车辆撤回流程 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean stopReserveCar(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
|
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
String userSid = appBusMainDepositFlowTask.getUserSid(); |
|
|
|
String businessSid = appBusMainDepositFlowTask.getBusinessSid(); |
|
|
|
fl.setTaskId(appBusMainDepositFlowTask.getTaskId()); |
|
|
|
fl.setInstanceId(appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
fl.setComment(appBusMainDepositFlowTask.getComment()); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.revokeProcess(fl); |
|
|
|
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> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
if (incomingSourceRef.contains("start")) { |
|
|
|
paramMap.put("nodeState", SysFormLinkFlowStateEnum.UNCOMMITTED.getState()); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.UNCOMMITTED.getCode()); |
|
|
|
} else { |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
} |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 预定车辆驳回任务 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean rejectReserveCar(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
|
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
String userSid = appBusMainDepositFlowTask.getUserSid(); |
|
|
|
String businessSid = appBusMainDepositFlowTask.getBusinessSid(); |
|
|
|
fl.setTaskId(appBusMainDepositFlowTask.getTaskId()); |
|
|
|
fl.setInstanceId(appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
fl.setComment(appBusMainDepositFlowTask.getComment()); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.taskReject(fl); |
|
|
|
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> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
if (incomingSourceRef.contains("start")) { |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.REJECT.getCode()); |
|
|
|
} |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 预定车辆终止任务 |
|
|
|
* |
|
|
|
* @param appBusMainDepositFlowTask |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean recallReserveCar(AppBusMainDepositFlowTask appBusMainDepositFlowTask) { |
|
|
|
|
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
String userSid = appBusMainDepositFlowTask.getUserSid(); |
|
|
|
String businessSid = appBusMainDepositFlowTask.getBusinessSid(); |
|
|
|
fl.setTaskId(appBusMainDepositFlowTask.getTaskId()); |
|
|
|
fl.setInstanceId(appBusMainDepositFlowTask.getProcInsId()); |
|
|
|
fl.setComment(appBusMainDepositFlowTask.getComment()); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean resultBean = flowTaskFeign.breakProcess(fl); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("nodeState", String.valueOf(resultBean.getData())); |
|
|
|
paramMap.put("taskDefKey", "Event_end"); |
|
|
|
paramMap.put("flowState", SysFormLinkFlowStateEnum.BREAK.getCode()); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |