优化商品模块的库存统计
This commit is contained in:
@@ -215,20 +215,6 @@ public class DepotItemService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long findByTypeAndMaterialId(String type, Long mId) throws Exception{
|
||||
Long result = 0l;
|
||||
try{
|
||||
if(type.equals(TYPE)) {
|
||||
result= depotItemMapperEx.findByTypeAndMaterialIdIn(mId);
|
||||
} else {
|
||||
result= depotItemMapperEx.findByTypeAndMaterialIdOut(mId);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<DepotItemVo4WithInfoEx> getDetailList(Long headerId)throws Exception {
|
||||
List<DepotItemVo4WithInfoEx> list =null;
|
||||
try{
|
||||
|
||||
@@ -100,9 +100,8 @@ public class MaterialService {
|
||||
}
|
||||
}
|
||||
m.setMaterialOther(materialOther);
|
||||
Long InSum = depotItemService.findByTypeAndMaterialId("入库", m.getId());
|
||||
Long OutSum = depotItemService.findByTypeAndMaterialId("出库", m.getId());
|
||||
m.setStock(InSum - OutSum);
|
||||
Long tenantId = m.getTenantId();
|
||||
m.setStock(depotItemService.getStockByParam(null,m.getId(),null,null,tenantId));
|
||||
resList.add(m);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user