Commit 1b787788 authored by 季圣华's avatar 季圣华
Browse files

解决实时库存计算的bug

parent 33142434
......@@ -491,10 +491,17 @@ public class DepotItemService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void deleteDepotItemHeadId(Long headerId)throws Exception {
DepotItemExample example = new DepotItemExample();
example.createCriteria().andHeaderIdEqualTo(headerId);
try{
//1、查询删除前的单据明细
List<DepotItem> depotItemList = getListByHeaderId(headerId);
//2、删除单据明细
DepotItemExample example = new DepotItemExample();
example.createCriteria().andHeaderIdEqualTo(headerId);
depotItemMapper.deleteByExample(example);
//3、计算删除之后单据明细中商品的库存
for(DepotItem depotItem : depotItemList){
updateCurrentStock(depotItem);
}
}catch(Exception e){
JshException.writeFail(logger, e);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment