|
|
|
@ -12,10 +12,13 @@ import com.logpm.trunkline.service.ITrunklineCarsLoadService;
|
|
|
|
|
import com.logpm.trunkline.vo.TrunklineCarsLoadVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
|
@Service |
|
|
|
@ -48,9 +51,47 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
public void startCarByLoadId(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
log.info("############startCarByLoadId: 发车"); |
|
|
|
|
Long loadId = loadCarsDTO.getLoadId(); |
|
|
|
|
Integer startCarType = loadCarsDTO.getStartCarType(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
//先查询该仓库
|
|
|
|
|
//先查询车辆配载计划
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
|
if(Objects.isNull(carsLoadEntity)){ |
|
|
|
|
log.warn("#############startCarByLoadId: 配载计划不存在 loadId={}",loadId); |
|
|
|
|
throw new CustomerException(400,"配载计划不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(startCarType == 1){ |
|
|
|
|
//车辆配载发车
|
|
|
|
|
//查询发站仓节点信息
|
|
|
|
|
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findStartNodeByLoadId(loadId); |
|
|
|
|
String nodeStatus = carsLoadLineEntity.getNodeStatus();//节点状态
|
|
|
|
|
Date startDate = carsLoadLineEntity.getStartDate(); |
|
|
|
|
if(!Objects.isNull(startDate)){ |
|
|
|
|
log.warn("#############startCarByLoadId: 车辆已发车 startDate={}",startDate); |
|
|
|
|
throw new CustomerException(405,"车辆已发车"); |
|
|
|
|
} |
|
|
|
|
if(!"0".equals(nodeStatus)){ |
|
|
|
|
log.warn("#############startCarByLoadId: 车辆已发车 nodeStatus={}",nodeStatus); |
|
|
|
|
throw new CustomerException(405,"车辆已发车"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(startCarType == 2){ |
|
|
|
|
//到车管理的发车
|
|
|
|
|
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEndNodeByLoadId(loadId); |
|
|
|
|
String nodeStatus = carsLoadLineEntity.getNodeStatus();//节点状态
|
|
|
|
|
if(!"0".equals(nodeStatus)){ |
|
|
|
|
log.warn("#############startCarByLoadId: 车辆已发车 nodeStatus={}",nodeStatus); |
|
|
|
|
throw new CustomerException(405,"车辆已发车"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|