futian.liu
2023-11-27 df34fa79f9616167babe07b0f63da6e9ddcc9620
consum-base/src/main/java/com/consum/base/service/LWhFormInventoryGoodsServiceImpl.java
@@ -8,6 +8,8 @@
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
 * @Description 盘点单物品
@@ -16,6 +18,7 @@
 */
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED)
public class LWhFormInventoryGoodsServiceImpl extends BaseServiceImpl {
    /**
@@ -56,18 +59,18 @@
            Integer inventoryCount = inventoryGoods.getInventoryCount();
            Integer realNum = inventoryGoods.getRealNum();
            if (realNum != null) {
                int errorCount = inventoryCount - realNum;
                int errorCount = realNum - inventoryCount;
                lWhFormInventoryGoods.setInventoryCounts(realNum);
                lWhFormInventoryGoods.setErrorCounts(errorCount);
                lWhFormInventoryGoods.setErrorCounts(Math.abs(errorCount));
                //盘点结果(1=正常;2=盘盈;3=盘亏)
                lWhFormInventoryGoods.setInventoryResult((errorCount > 0) ? 2 : (errorCount < 0) ? 3 : 1);
                goodsList.add(lWhFormInventoryGoods);
                // TODO 批量更新
                this.update(lWhFormInventoryGoods);
//                goodsList.add(lWhFormInventoryGoods);
            }
//            this.update(lWhFormInventoryGoods);
        }
        return this.updateBatch(goodsList);
//        return 1;
        return 1;
    }
    /**