解决实时库存计算的bug
This commit is contained in:
@@ -491,10 +491,17 @@ public class DepotItemService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void deleteDepotItemHeadId(Long headerId)throws Exception {
|
public void deleteDepotItemHeadId(Long headerId)throws Exception {
|
||||||
DepotItemExample example = new DepotItemExample();
|
|
||||||
example.createCriteria().andHeaderIdEqualTo(headerId);
|
|
||||||
try{
|
try{
|
||||||
|
//1、查询删除前的单据明细
|
||||||
|
List<DepotItem> depotItemList = getListByHeaderId(headerId);
|
||||||
|
//2、删除单据明细
|
||||||
|
DepotItemExample example = new DepotItemExample();
|
||||||
|
example.createCriteria().andHeaderIdEqualTo(headerId);
|
||||||
depotItemMapper.deleteByExample(example);
|
depotItemMapper.deleteByExample(example);
|
||||||
|
//3、计算删除之后单据明细中商品的库存
|
||||||
|
for(DepotItem depotItem : depotItemList){
|
||||||
|
updateCurrentStock(depotItem);
|
||||||
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user