use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class ProductSettlementService method increaseCurMonthSale.
public void increaseCurMonthSale(@NotNull Map<LongIdentity, Integer> productCountsMap) {
List<Product> products = repository.instancesOf(productCountsMap.keySet());
for (Product product : products) {
int count = productCountsMap.get(product.getId());
product.increaseCurMonthSale(count);
repository.update(product);
}
}
use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class ProductSettlementService method calcSettlement.
public int calcSettlement(@NotNull Map<LongIdentity, Integer> productCountsMap, @NotNull List<ProductSettlement> settlements) {
List<Product> products = repository.instancesOf(productCountsMap.keySet());
int totalPriceFen = 0;
settlements.clear();
for (Product product : products) {
int count = productCountsMap.get(product.getId());
ProductSettlement settlement = product.settlePrice(count);
totalPriceFen += settlement.getSettlePriceFen();
settlements.add(settlement);
}
return totalPriceFen;
}
Aggregations