同位置的不让移位

This commit is contained in:
zhou-hongcheng
2026-03-17 19:00:02 +08:00
parent 742ef6ac1f
commit ef5a1be76c
@@ -522,6 +522,14 @@ public class ShiftManageDomainService {
if (4 == shiftManagePO.getShiftStatus()) {
throw new ServiceException("移位单【" + shiftManagePO.getShiftNumber() + "】已完成移位,请重新选择");
}
List<ShiftMaterialDetailDO> shiftMaterialDetailList = shiftManageDO.getShiftMaterialDetailList();
for (ShiftMaterialDetailDO shiftMaterialDetailDO : shiftMaterialDetailList) {//原始库位与目标库位不能一致
String oldLoc = shiftMaterialDetailDO.getOldStorageLocationCode();
String newLoc = shiftMaterialDetailDO.getNewStorageLocationCode();
if (oldLoc != null && oldLoc.equals(newLoc)) {
throw new ServiceException("移库失败:物料 [" + shiftMaterialDetailDO.getMaterialName() + "] 的源库位 (" + oldLoc + ") 与目标库位不能一致!");
}
}
//修改物料移位信息
shiftMaterialDetailService.batchShiftUpdate(shiftManageDO);
//修改移位单状态为完成移位