Commit f1ef55b5 authored by wxl's avatar wxl

入库带入编号

parent 66eaa9a6
...@@ -98,7 +98,7 @@ class IndexController extends AbstractActionController ...@@ -98,7 +98,7 @@ class IndexController extends AbstractActionController
try { try {
$otherWarehouseOrder = $this->otherWarehouseOrderManager->addOtherWarehouseOrder($data, $goodsData, $this->adminSession('admin_id')); $otherWarehouseOrder = $this->otherWarehouseOrderManager->addOtherWarehouseOrder($data, $goodsData, $this->adminSession('admin_id'));
$this->otherWarehouseOrderGoodsManager->addOtherWarehouseOrderGoods($goodsData, $data['warehouseId'], $otherWarehouseOrder->getOtherWarehouseOrderId()); $this->otherWarehouseOrderGoodsManager->addOtherWarehouseOrderGoods($goodsData, $data['warehouseId'], $otherWarehouseOrder->getOtherWarehouseOrderId());
$allWarehouseOrderGoodsManager->addAllWarehouseOrderGoods($goodsData, $data['warehouseId'], $otherWarehouseOrder->getOtherWarehouseOrderId()); $allWarehouseOrderGoodsManager->addAllWarehouseOrderGoods($goodsData, $data['warehouseId'], $otherWarehouseOrder->getOtherWarehouseOrderId(),$otherWarehouseOrder->getWarehouseOrderSn());
$this->getEventManager()->trigger('other-warehouse-order.insert.post', $this, $otherWarehouseOrder); $this->getEventManager()->trigger('other-warehouse-order.insert.post', $this, $otherWarehouseOrder);
......
...@@ -43,6 +43,12 @@ class AllWarehouseOrderGoods extends BaseEntity ...@@ -43,6 +43,12 @@ class AllWarehouseOrderGoods extends BaseEntity
*/ */
private $purchaseWarehouseOrderId; private $purchaseWarehouseOrderId;
/**
* 其他入库采购入库对应表入库单号
* @ORM\Column(name="warehouse_order_sn", type="string", length=100)
*/
private $warehouseOrderSn;
/** /**
* 仓库id * 仓库id
* @ORM\Column(name="warehouse_id", type="integer", length=11) * @ORM\Column(name="warehouse_id", type="integer", length=11)
...@@ -163,6 +169,21 @@ class AllWarehouseOrderGoods extends BaseEntity ...@@ -163,6 +169,21 @@ class AllWarehouseOrderGoods extends BaseEntity
$this->purchaseWarehouseOrderId = $purchaseWarehouseOrderId; $this->purchaseWarehouseOrderId = $purchaseWarehouseOrderId;
} }
/**
* @return mixed
*/
public function getWarehouseOrderSn()
{
return $this->warehouseOrderSn;
}
/**
* @param mixed $warehouseOrderSn
*/
public function setWarehouseOrderSn($warehouseOrderSn): void
{
$this->warehouseOrderSn = $warehouseOrderSn;
}
/** /**
* @return mixed * @return mixed
*/ */
......
...@@ -40,7 +40,7 @@ class AllWarehouseOrderGoodsManager ...@@ -40,7 +40,7 @@ class AllWarehouseOrderGoodsManager
* @throws \Doctrine\ORM\OptimisticLockException * @throws \Doctrine\ORM\OptimisticLockException
* @throws \Doctrine\Persistence\Mapping\MappingException * @throws \Doctrine\Persistence\Mapping\MappingException
*/ */
public function addAllWarehouseOrderGoods(array $data, $warehouseId, $otherWarehouseOrderId) public function addAllWarehouseOrderGoods(array $data, $warehouseId, $otherWarehouseOrderId,$warehouseOrderSn)
{ {
foreach ($data['goodsId'] as $key => $value) { foreach ($data['goodsId'] as $key => $value) {
$goodsInfo = $this->entityManager->getRepository(Goods::class)->findOneBy(['goodsId' => $value]); $goodsInfo = $this->entityManager->getRepository(Goods::class)->findOneBy(['goodsId' => $value]);
...@@ -48,6 +48,7 @@ class AllWarehouseOrderGoodsManager ...@@ -48,6 +48,7 @@ class AllWarehouseOrderGoodsManager
$allWarehouseGoods = new AllWarehouseOrderGoods(); $allWarehouseGoods = new AllWarehouseOrderGoods();
$allWarehouseGoods->setAllWarehouseOrderGoodsId(null); $allWarehouseGoods->setAllWarehouseOrderGoodsId(null);
$allWarehouseGoods->setOtherWarehouseOrderId($otherWarehouseOrderId); $allWarehouseGoods->setOtherWarehouseOrderId($otherWarehouseOrderId);
$allWarehouseGoods->setWarehouseOrderSn($warehouseOrderSn);
$allWarehouseGoods->setWarehouseId($warehouseId); $allWarehouseGoods->setWarehouseId($warehouseId);
$allWarehouseGoods->setWarehouseGoodsBuyNum($data['goodsBuyNum'][$key]); $allWarehouseGoods->setWarehouseGoodsBuyNum($data['goodsBuyNum'][$key]);
$allWarehouseGoods->setWarehouseGoodsPrice($data['goodsPrice'][$key]); $allWarehouseGoods->setWarehouseGoodsPrice($data['goodsPrice'][$key]);
...@@ -81,6 +82,7 @@ class AllWarehouseOrderGoodsManager ...@@ -81,6 +82,7 @@ class AllWarehouseOrderGoodsManager
$allWarehouseGoods = new AllWarehouseOrderGoods(); $allWarehouseGoods = new AllWarehouseOrderGoods();
$allWarehouseGoods->setAllWarehouseOrderGoodsId(null); $allWarehouseGoods->setAllWarehouseOrderGoodsId(null);
$allWarehouseGoods->setPurchaseWarehouseOrderId($warehouseOrder->getWarehouseOrderId()); $allWarehouseGoods->setPurchaseWarehouseOrderId($warehouseOrder->getWarehouseOrderId());
$allWarehouseGoods->setWarehouseOrderSn($warehouseOrder->getWarehouseOrderSn());
$allWarehouseGoods->setWarehouseId($warehouseOrder->getWarehouseId()); $allWarehouseGoods->setWarehouseId($warehouseOrder->getWarehouseId());
$allWarehouseGoods->setWarehouseGoodsBuyNum($goodsValue->getPGoodsBuyNum()); $allWarehouseGoods->setWarehouseGoodsBuyNum($goodsValue->getPGoodsBuyNum());
$allWarehouseGoods->setWarehouseGoodsPrice($goodsValue->getPGoodsPrice()); $allWarehouseGoods->setWarehouseGoodsPrice($goodsValue->getPGoodsPrice());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment