feat(盘点执行):

1.盘点执行:增加校验库存的仓库是否等于盘点单的仓库,报错”库存XXX仓库XXX与盘点单仓库XXX不一致“
This commit is contained in:
leiqiaozhen 2025-03-12 16:12:04 +08:00
parent 1381bb0cfc
commit 581ede3786
2 changed files with 24 additions and 4 deletions

View File

@ -359,8 +359,14 @@ public class ZWmsInventoryCheckSnapshot extends Model<ZWmsInventoryCheckSnapshot
@ApiModelProperty(value="差异类型")
@TableField(exist = false)
private String differenceType;
/**
* 盘点单所在仓库
*/
@ApiModelProperty(value="盘点单所在仓库")
@TableField(exist = false)
private String checkNoWarehouse;
public static String genHandle(String site, String checkNo, String inventoryId) {
return HandleBoProcessor.genHandle(KW_INVENTORY_CHECK_SNAPSHOT_BO, site, checkNo, inventoryId);
}

View File

@ -167,8 +167,22 @@ public class ZWmsInventoryCheckServiceImpl extends ServiceImpl<ZWmsInventoryChec
if (inventoryById == null) {
throw BusinessException.build("条码[" + inventoryId + "]不存在库存");
}
// 写入盘点记录表
// 获取盘点单所在仓库
String checkNoWarehouse = zWmsInventoryCheckSnapshot.getCheckNoWarehouse();
// 获取条码所在仓库
String erpStorageLocation = inventoryById.getErpStorageLocation();
// 判断
boolean showError = (StrUtil.isBlank(checkNoWarehouse) && StrUtil.isNotBlank(erpStorageLocation)) ||
(StrUtil.isNotBlank(checkNoWarehouse) && StrUtil.isBlank(erpStorageLocation)) ||
(StrUtil.isNotBlank(checkNoWarehouse) && StrUtil.isNotBlank(erpStorageLocation) && !checkNoWarehouse.equals(erpStorageLocation));
if (showError) {
// 库存XXX仓库XXX与盘点单仓库XXX不一致
throw BusinessException.build("库存[" + inventoryId + "],仓库[" + erpStorageLocation + "]与盘点单仓库[" + checkNoWarehouse + "]不一致!");
}
// 写入盘点记录表
ZWmsInventoryCheckCount zWmsInventoryCheckCount = new ZWmsInventoryCheckCount();
BeanUtil.copyProperties(inventoryById, zWmsInventoryCheckCount, "handle", "dateUpdate", "updater");
zWmsInventoryCheckCount.setHandle(ZWmsInventoryCheckCount.genHandle(site, zWmsInventoryCheckSnapshot.getCheckNo(),