调拨订单导出和插入修改
This commit is contained in:
parent
95514a0da6
commit
83fe8c4539
@ -39,7 +39,8 @@ class InventoryTransferController extends BaseAdminController
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new InventoryTransferValidate())->post()->goCheck('add');
|
||||
$params = $this->request->post();
|
||||
// $params = (new InventoryTransferValidate())->post()->goCheck('add');
|
||||
$result = InventoryTransferLogic::add($params, $this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
|
@ -59,7 +59,7 @@ class InventoryTransferLogic extends BaseLogic
|
||||
$outProduct = !empty($outProducts[$v['id']]) ? $outProducts[$v['id']] : ['stock' => 0, 'id' => 0, 'product_id' => $v['id']];
|
||||
$inProduct = !empty($inProducts[$v['id']]) ? $inProducts[$v['id']] : ['stock' => 0, 'id' => 0, 'product_id' => $v['id']];
|
||||
if ($outProduct['stock'] < $v['nums']) {
|
||||
throw new BusinessException("{$v['nums']}-{$outProduct['stock']}出库商品{$find['one_id']} 库存不足 {$outProduct['product_id']} 调拨数量不能大于当前仓库库存");
|
||||
throw new BusinessException("出库商品库存不足 {$outProduct['product_id']} 调拨数量不能大于当前仓库库存");
|
||||
}
|
||||
$insert[] = [
|
||||
'oid' => $find['id'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user