zhang
6 天以前 39efc87b3794f957aad73acf3a430b84e3a19b27
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/StaReserveServiceImpl.java
@@ -5,6 +5,7 @@
import com.zy.acs.framework.common.Cools;
import com.zy.acs.framework.exception.CoolException;
import com.zy.acs.manager.common.exception.BusinessException;
import com.zy.acs.manager.manager.entity.Segment;
import com.zy.acs.manager.manager.entity.Sta;
import com.zy.acs.manager.manager.entity.StaReserve;
import com.zy.acs.manager.manager.entity.Task;
@@ -28,8 +29,8 @@
@Service("staReserveService")
public class StaReserveServiceImpl extends ServiceImpl<StaReserveMapper, StaReserve> implements StaReserveService {
    public static final Long RESERVE_EXPIRE_TIME = 30 * 60 * 1000L;
    public static final Long WAITING_EXPIRE_TIME = 5 * 60 * 1000L;
    public static final Long RESERVE_EXPIRE_TIME = 30 * 60L;
    public static final Long WAITING_EXPIRE_TIME = 5 * 60L;
    public static final Integer DEFAULT_QTY = 1;
@@ -109,11 +110,13 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean waitingStaReserve(Sta sta, Task task, Integer qty, StaReserveType type) {
    public Boolean waitingStaReserve(Sta sta, Task task, Segment seg, Integer qty, StaReserveType type) {
        qty = Optional.ofNullable(qty).orElse(DEFAULT_QTY);
        // update reserve to be waiting state
        int changed = this.baseMapper.updateStateToWaiting(task.getId()
        int changed = this.baseMapper.updateStateToWaiting(
                task.getId()
                , seg.getId()
                , sta.getId()
                , type.toString()
                , StaReserveStateType.WAITING.toString()