|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.entity.product.ProductInfo;
|
|
|
+import com.fjhx.entity.supplier.GetSupplierPriceByProductIdsDto;
|
|
|
import com.fjhx.entity.supplier.Supplier;
|
|
|
import com.fjhx.entity.supplier.SupplierPrice;
|
|
|
import com.fjhx.mapper.supplier.SupplierPriceMapper;
|
|
@@ -85,4 +86,17 @@ public class SupplierPriceServiceImpl extends ServiceImpl<SupplierPriceMapper, S
|
|
|
JSONObject.parseArray(JSONObject.toJSONString(condition.get("goodsIds")), Long.class))
|
|
|
.list();
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<Long, BigDecimal> getSupplierPriceByProductIds(GetSupplierPriceByProductIdsDto dto) {
|
|
|
+ Long supplierId = dto.getSupplierId();
|
|
|
+ Assert.notEmpty(supplierId, "供应商id不能为空");
|
|
|
+
|
|
|
+ List<Long> productIdList = dto.getProductIdList();
|
|
|
+ Assert.notEmpty(productIdList, "产品id数组不能为空");
|
|
|
+
|
|
|
+ return getKV(SupplierPrice::getMaterialId, SupplierPrice::getPrice,
|
|
|
+ q -> q.eq(SupplierPrice::getSupplierId, supplierId).in(SupplierPrice::getMaterialId, productIdList));
|
|
|
+ }
|
|
|
+
|
|
|
}
|