cy
2023-11-27 41dd97a3255d581d4013529730cedfb3f8f8e8ea
consum-base/src/main/java/com/consum/base/service/LWhFormInventoryGoodsServiceImpl.java
@@ -4,10 +4,13 @@
import com.consum.base.pojo.response.FormInventoryGoodsVO;
import com.consum.model.po.LWhFormInventoryGoods;
import com.walker.jdbc.service.BaseServiceImpl;
import java.util.ArrayList;
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;
import java.util.ArrayList;
import java.util.List;
/**
 * @Description 盘点单物品
@@ -16,6 +19,7 @@
 */
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED)
public class LWhFormInventoryGoodsServiceImpl extends BaseServiceImpl {
    /**
@@ -56,9 +60,9 @@
            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);