出库时验证双深位问题

main
judy 1 year ago
parent 4e13b1c91d
commit 82f65b06c7
  1. 20
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  2. 37
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java
  3. 11
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinPickupServiceImpl.java

@ -769,12 +769,30 @@ public class ScheduledTasks {
.last("limit 1") .last("limit 1")
); );
if (businDataTaskIsnotDeep != null){ if (businDataTaskIsnotDeep != null){
//单深位有任务,优先下发单深位任务
log.info("查询到单深位的任务:"+taskVoid); log.info("查询到单深位的任务:"+taskVoid);
businDataTask=businDataTaskIsnotDeep; businDataTask=businDataTaskIsnotDeep;
location=one;
}else{
//单深位无任务,再查询外面深位是否有库存,如果有,更新此任务的取货路径
if ("1".equals(one.getLocationStatus()) || "2".equals(one.getLocationStatus())){
//先把深位的货位状态改为有货或空托状态
if(businDataTaskGoodsVos !=null && businDataTaskGoodsVos.size()>0){
location.setLocationStatus("1");
}else {
location.setLocationStatus("2");
}
iBaseLocationService.updateById(location);
businDataTask.setFromColumn(one.getLocationColumn());
businDataTask.setFromRow(one.getLocationRow());
businDataTask.setFromLayer(one.getLayer());
businDataTask.setLocationId(one.getId());
location=one; location=one;
} }
} }
} }
}
location.setLocationStatus("4"); location.setLocationStatus("4");
iBaseLocationService.updateById(location); iBaseLocationService.updateById(location);
@ -787,6 +805,7 @@ public class ScheduledTasks {
//给库存添加出货预占 //给库存添加出货预占
iSysStockDetailService.updateBatchById(sysStockDetailList); iSysStockDetailService.updateBatchById(sysStockDetailList);
//给堆垛机下发任务
Result<Boolean> taskResult = outTask(businDataTask); Result<Boolean> taskResult = outTask(businDataTask);
if (taskResult.getCode() == HttpStatus.SUCCESS.getCode()) { if (taskResult.getCode() == HttpStatus.SUCCESS.getCode()) {
@ -825,6 +844,7 @@ public class ScheduledTasks {
} }
businDataTask.setDistinction(businDataTaskVo.getDistinction()); businDataTask.setDistinction(businDataTaskVo.getDistinction());
iBusinDataTaskService.saveOrUpdate(businDataTask); iBusinDataTaskService.saveOrUpdate(businDataTask);
businDataTaskVo = BeanUtil.toBean(businDataTask, BusinDataTaskVo.class); businDataTaskVo = BeanUtil.toBean(businDataTask, BusinDataTaskVo.class);
} else { } else {
businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存"); businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存");

@ -1442,11 +1442,39 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
String tunnel = baseLocation.getTunnel(); String tunnel = baseLocation.getTunnel();
String locationStatus = baseLocation.getLocationStatus(); String locationStatus = baseLocation.getLocationStatus();
if ("01".equals(tunnel) || "06".equals(tunnel)) { if ("01".equals(tunnel) || "06".equals(tunnel)) {
//如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致
String locationRow = baseLocation.getLocationRow(); String locationRow = baseLocation.getLocationRow();
String locationColumn = baseLocation.getLocationColumn(); String locationColumn = baseLocation.getLocationColumn();
String layer = baseLocation.getLayer(); String layer = baseLocation.getLayer();
//先判断货位是否已经有货,如果有则重新分配货位
if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) {
Result<BaseLocationVo> locationVoResult;
AssingEmptyLocBo assingEmptyLocBo = null;
if (businDataTaskGoodsVos !=null && businDataTaskGoodsVos.size()>0){
assingEmptyLocBo = new AssingEmptyLocBo();
assingEmptyLocBo.setBusinDataTaskGoodsVos(businDataTaskGoodsVos);
assingEmptyLocBo.setBatch(DateUtils.getDate());
assingEmptyLocBo.setGoodsNo(businDataTaskGoodsVos.get(0).getGoodsNo());
assingEmptyLocBo.setVehicheModel(businDataTaskGoodsVos.get(0).getVehicheModel());
assingEmptyLocBo.setTunnel(baseLocation.getTunnel());
locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, null);
}else {
locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, tunnel);
}
if (Result.isOk(locationVoResult)){
BaseLocationVo baseLocationVo = locationVoResult.getData();
log.info("给堆垛机下发任务:" + businDataTask.getId() + " 原货位:" +baseLocation.getLocationCode()+" 新货位:"+baseLocationVo.getLocationCode());
businDataTask.setToLayer(baseLocationVo.getLayer());
businDataTask.setToColumn(baseLocationVo.getLocationColumn());
businDataTask.setToRow(baseLocationVo.getLocationRow());
businDataTask.setLocationId(baseLocationVo.getId());
log.info("原货位已被占用,重新分配的货位:" + JsonUtil.toJSONString(baseLocationVo));
iBusinDataTaskService.updateById(businDataTask);
}
return;
}
//如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致
if ("2".equals(locationRow) || "3".equals(locationRow) || "14".equals(locationRow)) { if ("2".equals(locationRow) || "3".equals(locationRow) || "14".equals(locationRow)) {
if (locationRow.equals("2")) { if (locationRow.equals("2")) {
@ -1500,7 +1528,8 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
} }
} }
} else if ("1".equals(locationRow) || "4".equals(locationRow) || "15".equals(locationRow)) { }
else if ("1".equals(locationRow) || "4".equals(locationRow) || "15".equals(locationRow)) {
//检查单深位是否有货 //检查单深位是否有货
if (locationRow.equals("1")) { if (locationRow.equals("1")) {
locationRow = "2"; locationRow = "2";
@ -1550,7 +1579,8 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
} }
} }
} else if (tunnel.equals("06") && locationRow.equals("13")) { }
else if (tunnel.equals("06") && locationRow.equals("13")) {
if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) { if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) {
AssingEmptyLocBo assingEmptyLocBo = null; AssingEmptyLocBo assingEmptyLocBo = null;
if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) { if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) {
@ -1583,7 +1613,6 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
} else { } else {
if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) { if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) {
BaseLocationVo baseLocationVo = this.queryLocationByTunnel(tunnel); BaseLocationVo baseLocationVo = this.queryLocationByTunnel(tunnel);
BaseLocation newLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); BaseLocation newLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
newLocation.setLocationStatus("4"); newLocation.setLocationStatus("4");

@ -40,6 +40,7 @@ import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -331,7 +332,6 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
//添加库存明细 //添加库存明细
for (Map<String, String> map : goods) { for (Map<String, String> map : goods) {
SysStockDetail sysStockDetail = new SysStockDetail(); SysStockDetail sysStockDetail = new SysStockDetail();
// sysStockDetail.setStorageId(storageCode);
sysStockDetail.setContainerCode(DataTask.getContainerId()); sysStockDetail.setContainerCode(DataTask.getContainerId());
sysStockDetail.setQty(BigDecimal.valueOf(goods.size())); sysStockDetail.setQty(BigDecimal.valueOf(goods.size()));
sysStockDetail.setBatch(batch); sysStockDetail.setBatch(batch);
@ -420,8 +420,11 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
if (ObjectUtils.isEmpty(bo.getContainerId())){ if (ObjectUtils.isEmpty(bo.getContainerId())){
bo.setContainerId(0L); bo.setContainerId(0L);
} }
iBusinEnptyContainerService.emptyContainerFlowDir(point, bo.getContainerId(), agvno, null); Result<Boolean> booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, bo.getContainerId(), agvno, null);
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno); if (Result.isOk(booleanResult)){
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,5, TimeUnit.MINUTES);
}
// 创建任务 // 创建任务
//TODO 平库释放后直接去下挂逻辑,后续不需要可以删掉 //TODO 平库释放后直接去下挂逻辑,后续不需要可以删掉
// BusinDataTask task = new BusinDataTask(); // BusinDataTask task = new BusinDataTask();
@ -750,7 +753,7 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
Result<Boolean> booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, businPickupAddBo.getContainerId(), agvno, null); Result<Boolean> booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, businPickupAddBo.getContainerId(), agvno, null);
if (Result.isOk(booleanResult)){ if (Result.isOk(booleanResult)){
log.info("小组装放行完成:"+point+" AGV编号:"+agvno+" 任务号:"+businPickupAddBo.getTaskCode()); log.info("小组装放行完成:"+point+" AGV编号:"+agvno+" 任务号:"+businPickupAddBo.getTaskCode());
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno); redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,5,TimeUnit.MINUTES);
DataTask.setTaskStatus("2"); DataTask.setTaskStatus("2");
businDataTaskService.updateById(DataTask); businDataTaskService.updateById(DataTask);

Loading…
Cancel
Save