Commit 63cc252e by 崔彦峰

fix(goods): 修复权益服务项目验证逻辑

- 添加供应商代码和商品类型的条件判断
- 引入环境配置属性解析商品类型列表
- 仅当供应商为22且商品类型匹配时才验证权益服务项目
- 移除原有的简单非空检查逻辑
- 添加注释掉的旧验证代码以备参考
1 parent 48725818
...@@ -1034,12 +1034,20 @@ public class GoodsListingSubmitService { ...@@ -1034,12 +1034,20 @@ public class GoodsListingSubmitService {
if (!isSceneEquity(submitDTO.getBaseSceneCode()) || !hasDirectSalesMerchant(merchantRowIndexMap)) { if (!isSceneEquity(submitDTO.getBaseSceneCode()) || !hasDirectSalesMerchant(merchantRowIndexMap)) {
return true; return true;
} }
if (CollectionUtils.isNotEmpty(upgradeGoodsDTO.getUpgradeGoodsServiceItemsList())) { List<Integer> goodsTypes = parseCsvIntegerProperty(
return true; env.getProperty("smartcarlife.goodsType.equity", "126"));
} if (Objects.equals(upgradeGoodsDTO.getGoodsInfo().getSupplierCode(), "22")
&& goodsTypes.contains(upgradeGoodsDTO.getGoodsInfo().getGoodsType())
&& CollectionUtils.isEmpty(upgradeGoodsDTO.getUpgradeGoodsServiceItemsList())) {
setLineError(errorList, "权益服务项目缺失", rowIndex); setLineError(errorList, "权益服务项目缺失", rowIndex);
return false; return false;
} }
// if (CollectionUtils.isNotEmpty(upgradeGoodsDTO.getUpgradeGoodsServiceItemsList())) {
// return true;
// }
// setLineError(errorList, "权益服务项目缺失", rowIndex);
return true;
}
private boolean hasDirectSalesMerchant(Map<Integer, CreateBusinessApproveMerchantDTO> merchantRowIndexMap) { private boolean hasDirectSalesMerchant(Map<Integer, CreateBusinessApproveMerchantDTO> merchantRowIndexMap) {
if (MapUtil.isEmpty(merchantRowIndexMap)) { if (MapUtil.isEmpty(merchantRowIndexMap)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!