zhou zhou
2 天以前 6331e9aa3f0ced66084bb41de3245162ff8ae806
rsf-server/src/main/java/com/vincent/rsf/server/system/service/impl/FlowStepInstanceServiceImpl.java
@@ -1,12 +1,35 @@
package com.vincent.rsf.server.system.service.impl;
import com.vincent.rsf.server.system.entity.FlowInstance;
import com.vincent.rsf.server.system.mapper.FlowStepInstanceMapper;
import com.vincent.rsf.server.system.entity.FlowStepInstance;
import com.vincent.rsf.server.system.service.FlowInstanceService;
import com.vincent.rsf.server.system.service.FlowStepInstanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("flowStepInstanceService")
public class FlowStepInstanceServiceImpl extends ServiceImpl<FlowStepInstanceMapper, FlowStepInstance> implements FlowStepInstanceService {
    @Autowired
    private FlowInstanceService flowInstanceService;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean jumpCurrent(Long id) {
        FlowStepInstance flowStepInstance = getById(id);
        if (flowStepInstance == null || flowStepInstance.getFlowInstanceId() == null) {
            return false;
        }
        FlowInstance flowInstance = new FlowInstance();
        flowInstance.setId(flowStepInstance.getFlowInstanceId());
        flowInstance.setCurrentStepCode(flowStepInstance.getStepCode());
        flowInstance.setCurrentStepOrder(flowStepInstance.getStepOrder());
        flowInstance.setUpdateTime(new java.util.Date());
        return flowInstanceService.updateById(flowInstance);
    }
}