取货释放码头改为agv上报时取消

任务管理处理,从总任务控制改为单个任务控制
main
judy 1 year ago
parent 2f2863eaa6
commit 8a5de4d84a
  1. 63
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  2. 2
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinPickupServiceImpl.java
  3. 11
      shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java
  4. 3
      shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java

@ -162,6 +162,7 @@ public class ScheduledTasks {
Result<Boolean> booleanResult = rcsUtil.moveByAGV(moveBo);
return booleanResult;
}
public Result<Boolean> callAGV(Long taskId, int taskType, List<String> points, String agvno) {
@ -177,7 +178,6 @@ public class ScheduledTasks {
// @PostConstruct
// @Scheduled(cron = "0/3 * * * * ? ")
@Scheduled(fixedRate = 200)
@Transactional(rollbackFor = Exception.class)
public void task() {
log.info("开始获取需要执行的任务");
//获取待下发任务数据
@ -229,8 +229,15 @@ public class ScheduledTasks {
taskQueryBo.setTaskType("21");
List<BusinDataTaskVo> businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo);
businDataTaskVos.addAll(businDataTaskVo21);
for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) {
doTask(businDataTaskVo);
}
}
@Transactional(rollbackFor = Exception.class)
void doTask(BusinDataTaskVo businDataTaskVo) {
String taskType = businDataTaskVo.getTaskType();
Long taskId = businDataTaskVo.getId();
Long containerId = businDataTaskVo.getContainerId();
@ -241,9 +248,9 @@ public class ScheduledTasks {
if (taskType.equals("0") || taskType.equals("7")) {
//获取要出入库的条码信息
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId());
if(ObjectUtils.isEmpty(businDataTaskGoodsVos)){
continue;
}
// if (ObjectUtils.isEmpty(businDataTaskGoodsVos)) {
// continue;
// }
BusinDataTaskGoodsVo goodsVo = businDataTaskGoodsVos.get(0);
String vehicheModel = goodsVo.getVehicheModel();
String color = goodsVo.getColor();
@ -529,8 +536,7 @@ public class ScheduledTasks {
businDataTaskVo.setDpsNoTwo(stkPlcId);
iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class));
}
else if (taskType.equals("2")) {
} else if (taskType.equals("2")) {
Long plcId = 0L;
Long stkPlcId = 0L;
Boolean NUMBER = true;
@ -614,7 +620,8 @@ public class ScheduledTasks {
// int agvTaskType = Integer.valueOf(basePointDeviceVo.getIsDown());
System.out.println("中科 测试 需要删除");
// TODO 中科 测试 需要删除
String toPointNo = basePointDeviceVo.getPointNo();;
String toPointNo = basePointDeviceVo.getPointNo();
;
int agvTaskType = 33;
snPointMap.put("3", "XX");
points.add("XX");
@ -691,8 +698,7 @@ public class ScheduledTasks {
businDataTaskVo.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoTwo(stkPlcId);
}
else if (taskType.equals("1") ) {
} else if (taskType.equals("1")) {
Long plcId = 0L;
Long stkPlcId = 0L;
Boolean NUMBER = true;
@ -875,8 +881,7 @@ public class ScheduledTasks {
businDataTaskVo.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoTwo(stkPlcId);
}
else if (taskType.equals("3")) {
} else if (taskType.equals("3")) {
Long plcId = 0L;
Long stkPlcId = 0L;
Boolean NUMBER = true;
@ -1028,8 +1033,7 @@ public class ScheduledTasks {
// }
businDataTaskVo.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoTwo(stkPlcId);
}
else if (taskType.equals("4") || taskType.equals("5")) {
} else if (taskType.equals("4") || taskType.equals("5")) {
String randome = null;
//出库任务(正常出库、紧急出库)
//获取要出库的物料信息
@ -1172,8 +1176,7 @@ public class ScheduledTasks {
// }
}
}
else if (taskType.equals("11")||taskType.equals("12")){
} else if (taskType.equals("11") || taskType.equals("12")) {
String agvno = "";
int AgvType = 0;
//空治具流向呼叫agv失败后再次呼叫agv
@ -1244,8 +1247,7 @@ public class ScheduledTasks {
// }
}
}
}
else if (taskType.equals("10")){
} else if (taskType.equals("10")) {
//先判断补货入库是否是一套,如果是入存货区,否则入异常区
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId());
Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId());
@ -1266,8 +1268,7 @@ public class ScheduledTasks {
businDataTaskVo.setExceptionMsg("下发堆垛机指令失败");
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
}
}
else if(taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())){
} else if (taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())) {
//异常出库
//异常区货位
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_area));
@ -1389,11 +1390,9 @@ public class ScheduledTasks {
boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goods);
}
else if(taskType.equals(TaskTypeEnum.punching_delivery.getValue())){
} else if (taskType.equals(TaskTypeEnum.punching_delivery.getValue())) {
}
else if(taskType.equals(TaskTypeEnum.replenished_in.getValue())){
} else if (taskType.equals(TaskTypeEnum.replenished_in.getValue())) {
String agvno = null;
if (businDataTaskVo.getTaskPath().contains("manMade")) {
List agvtaskType = new ArrayList();
@ -1419,8 +1418,7 @@ public class ScheduledTasks {
iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno);
Result<Boolean> booleanResult = iPutInOutStorageService.reduceInventory(taskId, goodsNoStr);
}
else if (taskType.equals("21")){
} else if (taskType.equals("21")) {
// 冲孔出库
//待冲孔区货位
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area));
@ -1547,7 +1545,7 @@ public class ScheduledTasks {
log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints());
//统一提交任务数据
iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class));
}
}
//查看堆垛机是否拥堵
@ -1664,8 +1662,7 @@ public class ScheduledTasks {
//redisTemplate.opsForValue().set("stackerLock", "false");
return Result.err();
}
}
else {
} else {
return Result.err();
}
}
@ -1686,6 +1683,7 @@ public class ScheduledTasks {
/**
* 入库时有对应出库任务,将入库任务改为出库任务,直接将物料运往出库点位
*
* @param businDataTaskOutVo
* @param businDataTaskVo
*/
@ -1759,6 +1757,7 @@ public class ScheduledTasks {
/**
* 异常出库
*
* @author Comair
* @date 2023/8/12 19:32
*/
@ -1802,6 +1801,7 @@ public class ScheduledTasks {
/**
* 冲孔出库
*
* @author Comair
* @date 2023/8/12 19:33
*/
@ -1856,10 +1856,11 @@ public class ScheduledTasks {
/**
* 返回任务数最少的巷道号
* @author Comair
* @date 2023/8/12 20:57
*
* @param tunnelAll
* @return java.lang.String
* @author Comair
* @date 2023/8/12 20:57
*/
public String quickSort(List<String> tunnelAll) {
String tunnel = "";

@ -141,7 +141,7 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
businPickup.setContainerId(bo.getContainerId());
businPickup.setCreateTime(DateUtils.getNowDate());
businPickup.setBranchId(2L);
businPickup.setCreateBy("Comair");
businPickup.setCreateBy(SecurityUtils.getUsername());
Long puckupId = this.baseMapper.insertPuckup(businPickup);
String taskType = bo.getTaskType();

@ -263,10 +263,11 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue());
iBusinDataTaskService.updateById(businDataTask);
//更改点位状态为空闲
BasePoint basePoint = basePointService.selectBasePointByPointNo(fromPoint);
basePoint.setIsOccupy("0");
basePointService.updateById(basePoint);
//2024-07-12 呼叫AGV成功后不释放点位,待AGV取货完成后,再释放点位信息
// //更改点位状态为空闲
// BasePoint basePoint = basePointService.selectBasePointByPointNo(fromPoint);
// basePoint.setIsOccupy("0");
// basePointService.updateById(basePoint);
//更新货位状态为已分配
if (locationVo!=null){
BaseLocation baseLocation = BeanUtil.toBean(locationVo,BaseLocation.class);
@ -290,9 +291,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
}
businDataTask.setExceptionMsg(booleanResult.getMsg());
iBusinDataTaskService.updateById(businDataTask);
}
return booleanResult;
}

@ -606,6 +606,7 @@ public class RCSUtil {
List<BusinPickup> businPickupList = businPickupMapper.selectList(pickupQueryWrapper);
if (businPickupList.size() > 0) {
BusinPickup businPickup = businPickupList.get(0);
log.info("空治具回库时,释放码头点位信息:"+JsonUtil.toJSONString(businPickup));
BasePoint basePoint = iBasePointService.selectBasePointById(Long.valueOf(businPickup.getPointNo()));
basePoint.setIsActive("1");
basePoint.setIsOccupy("0");
@ -677,8 +678,6 @@ public class RCSUtil {
//更新任务数据
List<String> collect = agvMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).map(e -> e.getKey()).collect(Collectors.toList());
//log.error(collect.get(collect.size() - 1));
log.error(bo.getSn());
businDataTask.setAgvNo(bo.getRobotId());
businDataTask.setUpdateTime(DateUtils.getNowDate());

Loading…
Cancel
Save