|
|
@ -26,25 +26,31 @@ |
|
|
|
package com.yxt.anrui.scm.biz.scmvehiclegression; |
|
|
|
|
|
|
|
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.base.api.busvehicleapply.BusVehicleApply; |
|
|
|
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.flowtask.FlowTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
|
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.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoVo; |
|
|
|
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.portal.api.sysuser.app.AppUserOrgInfoVo; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.anrui.scm.api.scmfile.ScmFile; |
|
|
|
import com.yxt.anrui.scm.api.scmvehicleexamine.AppScmVehicleExaminePageQuery; |
|
|
|
import com.yxt.anrui.scm.api.scmvehicleexamine.AppScmVehicleExaminePageVo; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.*; |
|
|
|
import com.yxt.anrui.scm.biz.scmfile.ScmFileService; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.utils.DateUtils; |
|
|
|
import com.yxt.common.core.result.FileUploadResult; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -56,11 +62,11 @@ import com.yxt.common.core.vo.PagerVo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* Project: scm(scm) <br/> |
|
|
@ -93,6 +99,12 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
@Autowired |
|
|
|
private DictCommonFeign dictCommonFeign; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private FlowableFeign flowableFeign; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
|
|
|
|
private QueryWrapper<ScmVehicleGression> createQueryWrapper(ScmVehicleGressionQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
@ -167,7 +179,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
record.setShowDownloadBtn(true); |
|
|
|
record.setShowUpdateBtn(true); |
|
|
|
} |
|
|
|
if ("审批通过".equals(record.getState())) { |
|
|
|
if ("已办结".equals(record.getState())) { |
|
|
|
record.setShowUploadBtn(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -250,13 +262,18 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveCarTransferInfo(AppScmVehicleGressionDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(dto.getVinNo())) { |
|
|
|
return rb.setMsg("请选择车架号!"); |
|
|
|
} |
|
|
|
String s1 = ""; |
|
|
|
String type = "04"; |
|
|
|
String userSid = dto.getUserSid(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData(); |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData(); |
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
ScmVehicleGression scmVehicleGression = null; |
|
|
|
if (StringUtils.isBlank(dto.getSid())) { |
|
|
|
ScmVehicleGression scmVehicleGression = new ScmVehicleGression(); |
|
|
|
scmVehicleGression = new ScmVehicleGression(); |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
scmVehicleGression.setHandleState("1"); |
|
|
|
scmVehicleGression.setNodeState("未提交"); |
|
|
@ -272,12 +289,13 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (factoryImage.size() <= 0) { |
|
|
|
return rb.setMsg("保单照片不能为空"); |
|
|
|
} |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type); |
|
|
|
for (String s : factoryImage) { |
|
|
|
if (s.contains(fileUploadComponent.getUrlPrefix())) { |
|
|
|
s1 = s.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
ScmFile scmFile = new ScmFile(); |
|
|
|
scmFile.setAttachType("04"); |
|
|
|
scmFile.setAttachType(type); |
|
|
|
scmFile.setFileName("保单照片"); |
|
|
|
scmFile.setFilePath(s1); |
|
|
|
scmFile.setLinkSid(scmVehicleGression.getSid()); |
|
|
@ -285,14 +303,32 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
updateById(scmVehicleGression); |
|
|
|
if ("1".equals(dto.getInsuranceStateKey())) { // 如果保单状态为否 不保存保单照片
|
|
|
|
List<String> factoryImage = dto.getPolicyImage(); |
|
|
|
if (factoryImage.size() <= 0) { |
|
|
|
return rb.setMsg("保单照片不能为空"); |
|
|
|
} |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type); |
|
|
|
for (String s : factoryImage) { |
|
|
|
if (s.contains(fileUploadComponent.getUrlPrefix())) { |
|
|
|
s1 = s.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
ScmFile scmFile = new ScmFile(); |
|
|
|
scmFile.setAttachType(type); |
|
|
|
scmFile.setFileName("保单照片"); |
|
|
|
scmFile.setFilePath(s1); |
|
|
|
scmFile.setLinkSid(scmVehicleGression.getSid()); |
|
|
|
scmFileService.save(scmFile); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setMsg("保存成功"); |
|
|
|
return rb.success().setData(scmVehicleGression.getSid()).setMsg("保存成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -303,7 +339,9 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
*/ |
|
|
|
public AppScmVehicleGressionInfoVo getCarTransferInfo(String sid, String userSid) { |
|
|
|
String type1 = "04"; //保单照片
|
|
|
|
String type2 = "05"; //现场照片
|
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData(); |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData(); |
|
|
|
SysStaffinfoVo data1 = sysUserFeign.getSysUserByMobile(data.getStaffSid()).getData(); |
|
|
@ -318,6 +356,11 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
policyImage.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
vo.setPolicyImage(policyImage); |
|
|
|
List<ScmFile> scmFiles2 = scmFileService.selectByLinkSid(sid, type2); |
|
|
|
for (ScmFile scmFile : scmFiles2) { |
|
|
|
policyImage.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
vo.setImage(image); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
@ -439,4 +482,300 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
return baseMapper.selectCountByOrgSid(billsType, date, orgSid); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 提交 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitCarTransfer(SubmitCarTransferDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(userVoResultBean.getMsg()); |
|
|
|
} |
|
|
|
//根据staffSid获取用户的组织全路径
|
|
|
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
|
|
|
if (!staffOrgResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
int r = submitBusinessData(dto, scmVehicleGression); |
|
|
|
if (r == 3) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveCarTransferInfo(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
String businessSid = resultBean.getData(); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值
|
|
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
|
//若有网关,则赋值网关中判断的字段。
|
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.SCMCARTRANSFER.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> 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(scmVehicleGression.getTaskId()); |
|
|
|
bv.setTaskDefKey(scmVehicleGression.getNodeId()); |
|
|
|
bv.setComment(StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
} |
|
|
|
return rb; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断提交的流程是否被允许 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private synchronized int submitBusinessData(SubmitCarTransferDto dto, ScmVehicleGression scmVehicleGression) { |
|
|
|
int r = 0; |
|
|
|
if (StringUtils.isBlank(dto.getSid())) { |
|
|
|
r = 1; |
|
|
|
} else { |
|
|
|
if (scmVehicleGression != null) { |
|
|
|
String businessTaskId = scmVehicleGression.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; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新流程相关的状态 |
|
|
|
* |
|
|
|
* @param map |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private int updateFlowFiled(Map<String, Object> map) { |
|
|
|
return baseMapper.updateFlowFiled(map); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 办理 |
|
|
|
* |
|
|
|
* @param bv |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean complete(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(bv.getBusinessSid()); |
|
|
|
if (bv.getTaskId().equals(scmVehicleGression.getTaskId())) { |
|
|
|
boolean isTrue = false; |
|
|
|
if (StringUtils.isNotBlank(scmVehicleGression.getApplicantFunds())) { |
|
|
|
if ("0".equals(scmVehicleGression.getApplicantFunds())) { |
|
|
|
isTrue = false; |
|
|
|
} else { |
|
|
|
isTrue = true; |
|
|
|
} |
|
|
|
} else { |
|
|
|
isTrue = false; |
|
|
|
} |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("isTrue", isTrue); |
|
|
|
bv.setFormVariables(map); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取上一环节 |
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
|
|
|
ResultBean<List<GetNodeVo>> rb = new ResultBean<>(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
bv.setModelId(ProcDefEnum.SCMCARTRANSFER.getProDefId()); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取下一环节 |
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
|
|
|
ResultBean<List<GetNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
bv.setModelId(ProcDefEnum.SCMCARTRANSFER.getProDefId()); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 驳回任务 |
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean taskReject(ScmCarTransferTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(query.getBusinessSid()); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
String businessTaskId = scmVehicleGression.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
//更新业务中的流程相关的参数
|
|
|
|
updateFlowFiled(map); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 撤回 |
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean revokeProcess(ScmCarTransferTaskQuery query) { |
|
|
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
//根据业务sid查询移库申请
|
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = scmVehicleGression.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> 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("操作失败,提交的数据不一致!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 终止流程 |
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean breakProcess(ScmCarTransferTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = scmVehicleGression.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> 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("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* PC端-删除车辆移库申请 |
|
|
|
* |
|
|
|
* @param sids |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean deleteBySids(String[] sids) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String type = "04"; |
|
|
|
String type1 = "05"; |
|
|
|
List<String> sidsList = Arrays.asList(sids); |
|
|
|
if (sidsList.size() == 0) { |
|
|
|
return rb.setMsg("请选择要删除的数据"); |
|
|
|
} |
|
|
|
for (int i = 0; i < sidsList.size(); i++) { |
|
|
|
String sid = sidsList.get(i); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(sid); |
|
|
|
if ("未提交".equals(scmVehicleGression.getNodeState())) { |
|
|
|
deleteBySid(sid); |
|
|
|
scmFileService.deleteByLinkSidAndType(sid, type); |
|
|
|
scmFileService.deleteByLinkSidAndType(sid, type1); |
|
|
|
} else { |
|
|
|
return rb.setMsg("已在审核中!"); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setMsg("删除成功"); |
|
|
|
} |
|
|
|
} |