| | |
| | | package com.consum.base.service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.consum.base.core.utils.IdUtil; |
| | | 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; |
| | | |
| | | /** |
| | | * @Description 盘点单物品 |
| | |
| | | return this.select(inventoryGoods); |
| | | } |
| | | |
| | | |
| | | public List<FormInventoryGoodsVO> add(List<FormInventoryGoodsVO> inventoryGoodsList, Long inventoryId) { |
| | | List<LWhFormInventoryGoods> goodsList = new ArrayList<>(); |
| | | for (FormInventoryGoodsVO inventoryGoods : inventoryGoodsList) { |
| | |
| | | lWhFormInventoryGoods.setBaseGoodsModelsId(inventoryGoods.getId()); |
| | | lWhFormInventoryGoods.setBaseGoodsModelsName(inventoryGoods.getBaseGoodsModelsName()); |
| | | lWhFormInventoryGoods.setInitCounts(inventoryGoods.getInventoryCount()); |
| | | //保存成功后返回id,用来进行记录的更新 |
| | | // 保存成功后返回id,用来进行记录的更新 |
| | | inventoryGoods.setId(lWhFormInventoryGoods.getId()); |
| | | goodsList.add(lWhFormInventoryGoods); |
| | | } |
| | |
| | | int errorCount = realNum - inventoryCount; |
| | | lWhFormInventoryGoods.setInventoryCounts(realNum); |
| | | lWhFormInventoryGoods.setErrorCounts(Math.abs(errorCount)); |
| | | //盘点结果(1=正常;2=盘盈;3=盘亏) |
| | | // 盘点结果(1=正常;2=盘盈;3=盘亏) |
| | | lWhFormInventoryGoods.setInventoryResult((errorCount > 0) ? 2 : (errorCount < 0) ? 3 : 1); |
| | | // TODO 批量更新 |
| | | this.update(lWhFormInventoryGoods); |
| | | // goodsList.add(lWhFormInventoryGoods); |
| | | // goodsList.add(lWhFormInventoryGoods); |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据盘点单id删除盘点单物品 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | public void delByFormInventoryId(Long id) { |
| | | |
| | | } |
| | | |
| | | |
| | | } |