更新成本单价

This commit is contained in:
zjf committed 2025-06-13 13:37:40 +08:00
1 parent 8dffb993a4
commit 3decfc9bf7
2 files changed
+6 -1

No files matched your search

@@ -102,4 +102,9 @@ public interface SmErpSpuService extends IService<SmErpSpuEntity> {
*/
R importErpSpu(List<SmErpSpuImportDto> smErpSupplierImportDtos, BindingResult bindingResult);
// R calculateCostPrice();
}
@@ -163,7 +163,7 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
Double totalNum = smErpInventoryRecordsItemEntityList.stream().filter(Objects::nonNull).mapToDouble(itemEntity -> itemEntity.getPackageNum() * itemEntity.getQuantity()).sum();
int totalRealRrice = smErpInventoryRecordsItemEntityList.stream().filter(Objects::nonNull).mapToInt(SmErpCostPriceVo::getTotalAmount).sum();
double costPrice = (totalRealRrice / 100) / totalNum;
double costPrice = totalRealRrice / totalNum;
SmErpSpuEntity smErpSpuEntity = new SmErpSpuEntity();
smErpSpuEntity.setCostPrice(costPrice);