修改终点状态

liweidong
liweidong-hj 2 weeks ago
parent 24220839b6
commit 252ea60789
  1. 4
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 29
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/TaskExecuteRecordServiceImpl.java

@ -31,8 +31,8 @@ public interface LauncherConstant {
/** /**
* nacos dev 地址 * nacos dev 地址
*/ */
// String NACOS_DEV_ADDR = "192.168.249.27:8848"; String NACOS_DEV_ADDR = "192.168.249.27:8848";
String NACOS_DEV_ADDR = "127.0.0.1:8848"; // String NACOS_DEV_ADDR = "127.0.0.1:8848";
/**R /**R
* nacos prod 地址 * nacos prod 地址

@ -412,7 +412,7 @@ public class TaskExecuteRecordServiceImpl extends BaseServiceImpl<TaskExecuteRec
return false; return false;
} }
Station station = stationService.getByStationCode(taskExecuteRecord.getEndPos()); Station endStation = stationService.getByStationCode(taskExecuteRecord.getEndPos());
/** /**
* 3. 检查是否需要送到库位 * 3. 检查是否需要送到库位
@ -420,20 +420,33 @@ public class TaskExecuteRecordServiceImpl extends BaseServiceImpl<TaskExecuteRec
* 3.2 执行记录的终点是 站点 * 3.2 执行记录的终点是 站点
* 3.3 执行记录的终点是 输送线终点 * 3.3 执行记录的终点是 输送线终点
*/ */
if (null == task.getLocationId() || null != station || DROPOFF_CONVEYOR_LINE.equals(taskExecuteRecord.getEndPos())) { if (null == task.getLocationId() || null != endStation || DROPOFF_CONVEYOR_LINE.equals(taskExecuteRecord.getEndPos())) {
log.info("任务{}不需要送到库位,直接完成", taskCode); log.info("任务{}不需要送到库位,直接完成", taskCode);
log.info("终点位置为站点信息:{},直接完成", taskExecuteRecord.getEndPos()); log.info("终点位置为站点信息:{},直接完成", taskExecuteRecord.getEndPos());
Station station1 = stationService.getByStationCode(taskExecuteRecord.getStartPos()); Station startStation = stationService.getByStationCode(taskExecuteRecord.getStartPos());
// 起点位置为站点 将站点状态改为空闲 // 起点位置为站点 将站点状态改为空闲
if(null != station1){ if(null != startStation){
station1.setStationStatus(Station.STATUS_FREE); startStation.setStationStatus(Station.STATUS_FREE);
boolean update = stationService.updateById(station1); boolean update = stationService.updateById(startStation);
if (update) { if (update) {
log.info("站点释放成功:{}", station1.getStationCode()); log.info("站点释放成功:{}", startStation.getStationCode());
return true; return true;
} else { } else {
log.error("站点释放失败:{}", station1.getStationCode()); log.error("站点释放失败:{}", startStation.getStationCode());
return false;
}
}
// 终点位置为站点将状态修改为占用
if(null != endStation){
endStation.setStationStatus(Station.STATUS_OCCUPIED);
boolean update = stationService.updateById(endStation);
if (update) {
log.info("站点释放成功:{}", endStation.getStationCode());
return true;
} else {
log.error("站点释放失败:{}", endStation.getStationCode());
return false; return false;
} }
} }

Loading…
Cancel
Save