| | |
| | | import com.zy.acs.manager.manager.service.SegmentService; |
| | | import com.zy.acs.manager.manager.service.TravelService; |
| | | import com.zy.acs.framework.exception.CoolException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("travelService") |
| | | public class TravelServiceImpl extends ServiceImpl<TravelMapper, Travel> implements TravelService { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void finishAll(Long agvId) { |
| | | List<Travel> travelList = this.list(new LambdaQueryWrapper<Travel>() |
| | | .eq(Travel::getAgvId, agvId).eq(Travel::getState, TravelStateType.RUNNING.toString())); |
| | | for (Travel travel : travelList) { |
| | | travel.setState(TravelStateType.FINISH.toString()); |
| | | travel.setUpdateTime(new Date()); |
| | | if (!this.updateById(travel)) { |
| | | log.error("failed to finish travel all"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |