Commit bfdf022155074466d6fa80e0e65381d739414c5f
1 parent
283db991
库存更新修改
Showing
1 changed file
with
5 additions
and
3 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java
| ... | ... | @@ -142,9 +142,11 @@ public class MaterialInventoryServiceImpl implements MaterialInventoryService { |
| 142 | 142 | if (outNum == null) { |
| 143 | 143 | throw exception0(BAD_REQUEST.getCode(),"更新库存失败:outNum为空!"); |
| 144 | 144 | } |
| 145 | - materialInventory.setOutTotalNum(materialInventory.getOutTotalNum() + outNum); | |
| 146 | - materialInventory.setCurrentNum(materialInventory.getCurrentNum() - outNum); | |
| 147 | - return materialInventoryMapper.updateById(materialInventory); | |
| 145 | + MaterialInventoryDO update = new MaterialInventoryDO(); | |
| 146 | + update.setInventoryId(materialInventory.getInventoryId()); | |
| 147 | + update.setOutTotalNum(materialInventory.getOutTotalNum() + outNum); | |
| 148 | + update.setCurrentNum(materialInventory.getCurrentNum() - outNum); | |
| 149 | + return materialInventoryMapper.updateById(update); | |
| 148 | 150 | } |
| 149 | 151 | |
| 150 | 152 | @Override | ... | ... |