zhou zhou
2 天以前 6331e9aa3f0ced66084bb41de3245162ff8ae806
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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);
    }
 
}