移库时同排移库问题修改

This commit is contained in:
陆一凡 2025-03-19 16:25:17 +08:00
parent a7a83c8377
commit 6205b4f5cf
4 changed files with 11 additions and 16 deletions

View File

@ -251,7 +251,7 @@ public class JobComponent extends BaseController {
logger.info("移库没有可用库位");
return; // 移库没有可用库位
}
Location emptyLocationItem = locationUtils.checkCanUseChangeLocation(emptyLocations); // 取得新库位
Location emptyLocationItem = locationUtils.checkCanUseChangeLocation(emptyLocations,thisLocation); // 取得新库位
if(emptyLocationItem == null) {
logger.info("没有可移动库位,移动库位存在任务");
return; // 没有可用库位或者m库位存在干涉

View File

@ -13,8 +13,8 @@ import javax.print.attribute.standard.Destination;
*/
@Getter
public enum DestinationEnum {
EXIT_CODE("出库","111" ),
ENTRY_CODE("入库", "" );
EXIT_CODE("出库站台","111" ),
ENTRY_CODE("入库站台", "" );
private final String text;
private final String value;
@ -40,9 +40,7 @@ public enum DestinationEnum {
return null;
}
public static void main(String[] args) {
System.out.println(DestinationEnum.getByValue("111"));
}
}

View File

@ -132,7 +132,7 @@ public class OrderOutImplements implements IOrderOutService {
task.setRemark1("手动出库");
outTasks.add(task);
}
// 把这条库存记录可用数量更新 0
// 把这条库存记录可用数量进行更新
stockMapper.updateStockAvailableNumWithStockId(outStock.getStockId(), outStock.getAvailableNum()-outNum);
// 更新库存为出库中
stockMapper.updateStockStatusWithLocationId(outStock.getLocationId(), StockStatus.OUT.getCode());
@ -179,11 +179,6 @@ public class OrderOutImplements implements IOrderOutService {
}
int addResult = taskMapper.addTasks(outTasks);
if(addResult == outTasks.size()) {
// //删除出库单对应的任务
// int deleteResult =orderOutMapper.deleteOrderOut(orderOut.getRowId());
// if (deleteResult > 0){
// log.info("添加任务成功,删除出库单成功,任务:{}", outTasks);
// }
//更改出库单状态为出库中
OrderOut orderOutUpdateStatus = new OrderOut();
orderOutUpdateStatus.setRowId(rowId);
@ -260,7 +255,6 @@ public class OrderOutImplements implements IOrderOutService {
return new WmsApiResponse<>(1, "数量必须大于0", null);
}
/* 插入数据,插入记录表 */
//OrderOut orderOutList = new OrderOut();
OrderOut orderOut = new OrderOut();
orderOut.setRowId(UUID.randomUUID().toString());
orderOut.setRecordId(UUID.randomUUID().toString());
@ -281,7 +275,6 @@ public class OrderOutImplements implements IOrderOutService {
}else{
//空托盘出库
/* 插入数据,插入记录表 */
//OrderOut orderOutList = new OrderOut();
OrderOut orderOut = new OrderOut();
orderOut.setRowId(UUID.randomUUID().toString());
orderOut.setRecordId(UUID.randomUUID().toString());
@ -292,7 +285,6 @@ public class OrderOutImplements implements IOrderOutService {
orderOut.setRowNo(1);
orderOut.setGoodsId(request.goodsId);
orderOut.setGoodsNum(String.valueOf(request.goodsNum));
//Integer.parseInt(row.getQty())
orderOut.setUnit("");
orderOut.setStatus(OrderOutStatusEnum.CREATED.getCode());
orderOut.setCreateTime(new Timestamp(System.currentTimeMillis()));

View File

@ -9,6 +9,7 @@ import com.wms.model.entity.table.Task;
import com.wms.mapper.LocationMapper;
import com.wms.mapper.StockMapper;
import com.wms.mapper.TaskMapper;
import com.wms.service.LocationService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -150,13 +151,17 @@ public class LocationUtils {
* @param canUseLocations 可用的库位
* @return 可用的库位若没有可用的库位则返回 null
*/
public Location checkCanUseChangeLocation(List<Location> canUseLocations) {
public Location checkCanUseChangeLocation(List<Location> canUseLocations,Location thisLocation) {
if(canUseLocations == null || canUseLocations.isEmpty()) {
return null;
}
boolean canUse = true;
for (Location location : canUseLocations) {
/* 校验此位置是否有遮挡 */ /* 如果这位置有库存(可能出现记错导致有库存),或者这位置其他深度(不论深度大小)有任务则不采用此位置 */
// 如果在同一排上则不采用
if (location.getQueue().equals(thisLocation.getQueue())) {
continue;
}
/* 1 判断库存 */
Stock checkStock = new Stock();
checkStock.setLocationId(location.getLocationId());