Browse Source

Merge remote-tracking branch 'origin/feature-material-wangcz' into feature-material-wangcz

shenjj 7 years ago
parent
commit
b40b00a99a

+ 5 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2455,13 +2455,16 @@ public class ProductServiceImpl implements ProductService {
                 qtyContainPrice = 0.0d; qty = 0.0d; totalPrice = 0.0d;
                 if (doubleList == null) {
                     doubleList = new ArrayList<>();
+                    doubleList.add(qtyContainPrice);
+                    doubleList.add(qty);
+                    doubleList.add(totalPrice);
                 } else {
                     qtyContainPrice = doubleList.get(0);
                     qty = doubleList.get(1);
                     totalPrice = doubleList.get(2);
                 }
                 if (InOutBoundType.INBOUND.equals(inOutboundDetail.getCommodityInOutbound().getType())) {
-                    qty = NumberUtil.add(doubleList.get(0), inOutboundDetail.getQty());
+                    qty = NumberUtil.add(qty, inOutboundDetail.getQty());
                     if (inOutboundDetail.getPrice() != null) {
                         qtyContainPrice = NumberUtil.add(qtyContainPrice, inOutboundDetail.getQty());
                         totalPrice = NumberUtil.add(totalPrice, NumberUtil.mul(inOutboundDetail.getPrice(), inOutboundDetail.getQty()));
@@ -2492,7 +2495,7 @@ public class ProductServiceImpl implements ProductService {
             List<Goods> goodsList = goodsService.findByProductids(prids);
             for (Product product : products) {
                 for (Goods goods : goodsList) {
-                    if ((goods.getProductid() != null) && (goods.getProductid().longValue() == product.getId().longValue())) {
+                    if (goods.getProductid().longValue() == product.getId().longValue()) {
                         goods.setReserve(product.getErpReserve());
                         goods.setStatus();
                     }