日期:2014-05-17 浏览次数:20734 次
//保存到库存(delStorageInventory)
Member member = this.memberService.findBySn(sn);
List<DelStorageInventory> delStorageInventoryMembers = delStorageInventoryService.findByMember(member);
List<DelStorageInventory> delStorageInventorys = delStorageInventoryService.findByUPC(delStorageInventory.getUpc());
//当upc查找到的库存为0,或者member查找到的库存为0时,执行添加操作
if (delStorageInventoryMembers.size() == 0 || delStorageInventorys.size() == 0 || (member != null && member.getDelStorageInventorys() != null && member.getDelStorageInventorys().size() > 0)) {
delStorageInventory.setMember(this.memberService.findBySn(sn));
delStorageInventory.setOperator(this.adminService.getCurrent());
delStorageInventory.setDelStorage(this.delStorageService.find(delStorageId));
delStorageInventory.setSn(this.snService.generate(Sn.Type.delStorageInventory));
/** 数据验证 */
if(!isValid(delStorageInventory, new Class[0])) {
return ERROR_VIEW;
}
this.delStorageInventoryService.save(delStorageInventory);
}