Commit 4665faea by 崔彦峰

fix(goods): 修复商品上架审核中的数据源错误

- 将验证逻辑中的 record 对象替换为 oldRecord 对象
- 确保货架模型和货架类型的验证使用正确的数据源
- 防止因数据源错误导致的商品审核流程异常
1 parent cc2431cd
......@@ -399,8 +399,8 @@ public class GoodsListingApprovalService {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "产品信息为空,businessCode:" + record.getBusinessCode());
}
verifyVirtualInventory(record.getBusinessCode());
if (Objects.equals(record.getShelfModel(), ShelfModelEnum.SPECIAL_SHELF.getValue())
|| (Objects.equals(record.getShelfModel(), ShelfModelEnum.ORDINARY_SHELF.getValue()) && Objects.equals(record.getShelfType(), ShelfTypeEnum.SINGLE_STORE.getValue()))) {
if (Objects.equals(oldRecord.getShelfModel(), ShelfModelEnum.SPECIAL_SHELF.getValue())
|| (Objects.equals(oldRecord.getShelfModel(), ShelfModelEnum.ORDINARY_SHELF.getValue()) && Objects.equals(oldRecord.getShelfType(), ShelfTypeEnum.SINGLE_STORE.getValue()))) {
boolean hasNotFinish = products.stream().anyMatch(o -> !Objects.equals(o.getProfitRateCalFinish() ,StatusEnum.YES.getValue()));
if (hasNotFinish) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "利润率未计算完成");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!