no message
parent
8f046ea905
commit
da72afd3bb
|
|
@ -20,7 +20,7 @@ public class Zhengli {
|
||||||
|
|
||||||
Point point;
|
Point point;
|
||||||
|
|
||||||
double receivedQty;
|
double zlQty;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,5 +143,5 @@ public interface InventoryService {
|
||||||
*/
|
*/
|
||||||
List<RInvQuery> queryInvApp(String code);
|
List<RInvQuery> queryInvApp(String code);
|
||||||
|
|
||||||
Inventory getInventory(ItemKey itemKey, Point point, Stock stock, Dept dept, String type);
|
Inventory getInventory(ItemKey itemKey, Point point, Stock stock, Dept dept, String type,Area area);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -232,22 +232,27 @@ public class AsnDetailServiceImpl implements AsnDetailService {
|
||||||
Item item = asnDetail.getItem();
|
Item item = asnDetail.getItem();
|
||||||
Stock stock = zhengli.getStock();
|
Stock stock = zhengli.getStock();
|
||||||
Point point = zhengli.getPoint();
|
Point point = zhengli.getPoint();
|
||||||
|
Area area = zhengli.getArea();
|
||||||
if (item.getIsInspection()) {
|
if (item.getIsInspection()) {
|
||||||
throw new BadRequestException("该商品需要质检,请先完成质检!");
|
throw new BadRequestException("该商品需要质检,请先完成质检!");
|
||||||
}
|
}
|
||||||
|
if(stock==null){
|
||||||
|
throw new BadRequestException("整理的容器不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
//生成Itemkey
|
//生成Itemkey
|
||||||
ItemKey itemKey = itemKeyService.getItemKey(item, asnDetail.getPropC1(), asnDetail.getPropC3(), asnDetail.getPropC4(), asnDetail.getPropC5(), asnDetail.getPropC6(), asnDetail.getPropD1());
|
ItemKey itemKey = itemKeyService.getItemKey(item, asnDetail.getPropC1(), asnDetail.getPropC3(), asnDetail.getPropC4(), asnDetail.getPropC5(), asnDetail.getPropC6(), asnDetail.getPropD1());
|
||||||
|
|
||||||
//生成入库记录
|
//生成入库记录
|
||||||
Task task = taskService.storeTask(asnDetail, null, zhengli.getArea(), itemKey, null, point, zhengli.getReceivedQty());
|
Task task = taskService.storeTask(asnDetail, null, zhengli.getArea(), itemKey, null, point, zhengli.getZlQty());
|
||||||
task.setSrcStockCode(stock.getCode());
|
task.setSrcStockCode(stock.getCode());
|
||||||
task.setSrcStock(stock);
|
task.setSrcStock(stock);
|
||||||
taskRepository.save(task);
|
taskRepository.save(task);
|
||||||
|
|
||||||
//生成库存记录
|
//生成库存记录
|
||||||
Inventory inventory = inventoryService.getInventory(itemKey, point, stock, item.getDept(), BizStatus.ASN);
|
Inventory inventory = inventoryService.getInventory(itemKey, point, stock, item.getDept(), BizStatus.ASN,area);
|
||||||
inventory.setStatus("待入库");
|
inventory.setStatus("待入库");
|
||||||
|
inventory.setQuantity(inventory.getQuantity() + zhengli.getZlQty());
|
||||||
inventoryService.update(inventory);
|
inventoryService.update(inventory);
|
||||||
|
|
||||||
//是序列号的商品,生成序列号记录
|
//是序列号的商品,生成序列号记录
|
||||||
|
|
@ -262,7 +267,7 @@ public class AsnDetailServiceImpl implements AsnDetailService {
|
||||||
//回写收货数量
|
//回写收货数量
|
||||||
asnDetail.setStock(zhengli.getStock());
|
asnDetail.setStock(zhengli.getStock());
|
||||||
asnDetail.setPoint(zhengli.getPoint());
|
asnDetail.setPoint(zhengli.getPoint());
|
||||||
asnDetail.setReceivedQty(asnDetail.getReceivedQty() + zhengli.getReceivedQty());
|
asnDetail.setReceivedQty(asnDetail.getReceivedQty() + zhengli.getZlQty());
|
||||||
asnDetailRepository.save(asnDetail);
|
asnDetailRepository.save(asnDetail);
|
||||||
|
|
||||||
//容器绑定
|
//容器绑定
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ public class InventoryServiceImpl implements InventoryService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Inventory getInventory(ItemKey itemKey, Point point, Stock stock, Dept dept, String type) {
|
public Inventory getInventory(ItemKey itemKey, Point point, Stock stock, Dept dept, String type,Area area) {
|
||||||
List<Inventory> inventoryList = inventoryRepository.findByInventory(itemKey.getId(), point==null?null:point.getId(), stock.getId(), dept.getId());
|
List<Inventory> inventoryList = inventoryRepository.findByInventory(itemKey.getId(), point==null?null:point.getId(), stock.getId(), dept.getId());
|
||||||
Inventory inventory = null;
|
Inventory inventory = null;
|
||||||
if (inventoryList.size() > 0) {
|
if (inventoryList.size() > 0) {
|
||||||
|
|
@ -411,6 +411,7 @@ public class InventoryServiceImpl implements InventoryService {
|
||||||
inventory.setStock(stock);
|
inventory.setStock(stock);
|
||||||
inventory.setStockCode(stock.getCode());
|
inventory.setStockCode(stock.getCode());
|
||||||
inventory.setDept(dept);
|
inventory.setDept(dept);
|
||||||
|
inventory.setArea(area);
|
||||||
inventoryRepository.save(inventory);
|
inventoryRepository.save(inventory);
|
||||||
}
|
}
|
||||||
return inventory;
|
return inventory;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue