解决bug:解决其它入库单据中的再次保存的空指针异常
This commit is contained in:
@@ -278,12 +278,14 @@ public class DepotItemService {
|
||||
DepotItem depotItem = new DepotItem();
|
||||
try{
|
||||
DepotHead depotHead = depotHeadService.getDepotHead(linkStr);
|
||||
if(null!=depotHead && null!=depotHead.getId()) {
|
||||
DepotItemExample example = new DepotItemExample();
|
||||
example.createCriteria().andHeaderIdEqualTo(depotHead.getId()).andMaterialExtendIdEqualTo(meId).andIdEqualTo(linkId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<DepotItem> list = depotItemMapper.selectByExample(example);
|
||||
if(list!=null && list.size()>0) {
|
||||
depotItem = list.get(0);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
@@ -543,6 +545,7 @@ public class DepotItemService {
|
||||
//在更新模式进行状态赋值
|
||||
String unit = rowObj.get("unit").toString();
|
||||
Long preHeaderId = depotHeadService.getDepotHead(linkStr).getId();
|
||||
if(null!=preHeaderId) {
|
||||
//前一个单据的数量
|
||||
BigDecimal preNumber = getPreItemByHeaderIdAndMaterial(linkStr, depotItem.getMaterialExtendId(), depotItem.getLinkId()).getOperNumber();
|
||||
//除去此单据之外的已入库|已出库
|
||||
@@ -555,6 +558,7 @@ public class DepotItemService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtil.isExist(rowObj.get("unitPrice"))) {
|
||||
BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice");
|
||||
depotItem.setUnitPrice(unitPrice);
|
||||
|
||||
Reference in New Issue
Block a user