| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.acs.framework.common.BaseRes; |
| | | import com.zy.acs.manager.common.domain.TaskDto; |
| | | import com.zy.acs.manager.manager.controller.param.OpenBusSubmitParam; |
| | | import com.zy.acs.manager.manager.entity.Bus; |
| | | import com.zy.acs.manager.manager.enums.BusStsType; |
| | | import com.zy.acs.manager.manager.mapper.BusMapper; |
| | | import com.zy.acs.manager.manager.service.BusService; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("busService") |
| | | public class BusServiceImpl extends ServiceImpl<BusMapper, Bus> implements BusService { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String checkoutValid(OpenBusSubmitParam param) { |
| | | if (null == param) { |
| | | return BaseRes.PARAM; |
| | | } |
| | | if (Cools.isEmpty(param.getBatch())) { |
| | | return "Batch cannot be empty!"; |
| | | } |
| | | for (TaskDto dto : param.getTaskList()) { |
| | | if (!Cools.isEmpty(dto.getOriSta())) { |
| | | if (!Cools.isEmpty(dto.getOriLoc())) { |
| | | return "OriSta and OriLoc cannot exist at the same time!"; |
| | | } |
| | | if (Cools.isEmpty(dto.getDestSta()) && Cools.isEmpty(dto.getDestLoc())) { |
| | | return "Destination cannot be empty!"; |
| | | } |
| | | } |
| | | |
| | | if (!Cools.isEmpty(dto.getDestSta())) { |
| | | if (!Cools.isEmpty(dto.getDestLoc())) { |
| | | return "DestSta and DestLoc cannot exist at the same time!"; |
| | | } |
| | | if (Cools.isEmpty(dto.getOriSta()) && Cools.isEmpty(dto.getOriLoc())) { |
| | | return "Origin cannot be empty!"; |
| | | } |
| | | } |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<Bus> selectBySts(BusStsType busStsType) { |
| | | return this.selectBySts(busStsType, null); |
| | | } |