优化商品的库存计算
This commit is contained in:
@@ -198,13 +198,13 @@ public class DepotController {
|
||||
for(Depot depot: list) {
|
||||
DepotEx de = new DepotEx();
|
||||
if(mId!=0) {
|
||||
BigDecimal stock = materialService.getInitStock(mId, depot.getId());
|
||||
BigDecimal initStock = materialService.getInitStock(mId, depot.getId());
|
||||
BigDecimal currentStock = materialService.getCurrentStock(mId, depot.getId());
|
||||
de.setStock(stock);
|
||||
de.setAllStock(stock.add(currentStock));
|
||||
de.setInitStock(initStock);
|
||||
de.setCurrentStock(currentStock);
|
||||
} else {
|
||||
de.setStock(BigDecimal.ZERO);
|
||||
de.setAllStock(BigDecimal.ZERO);
|
||||
de.setInitStock(BigDecimal.ZERO);
|
||||
de.setCurrentStock(BigDecimal.ZERO);
|
||||
}
|
||||
de.setId(depot.getId());
|
||||
de.setName(depot.getName());
|
||||
|
||||
Reference in New Issue
Block a user