Browse Source

Merge branch 'dev_wf' of wugg/phpstock into version1.5

wufeng 2 năm trước cách đây
mục cha
commit
013e274a41
2 tập tin đã thay đổi với 36 bổ sung2 xóa
  1. 1 1
      app/admin/controller/Purchin.php
  2. 35 1
      app/command/handleYzOrderData.php

+ 1 - 1
app/admin/controller/Purchin.php

@@ -351,7 +351,7 @@ class Purchin extends Base
                                             ], "CKD", 1, $this->post);
 
                                             if ($is_stock[$v_outCode['orderCode']] == 1) {
-                                                //存品,推给库管和库管-张凯旋
+                                                //存品,推给库管和库管-张凯旋
                                                 $roleid = config('app.wsm_cgder_role');
                                                 $uids = Db::name('user_role')
                                                     ->where('is_del', 0)

+ 35 - 1
app/command/handleYzOrderData.php

@@ -487,7 +487,41 @@ class handleYzOrderData extends Command
                                     "action_type" => "create"//新建create,编辑edit,更改状态status
                                 ], "CKD", 0, $out);
 
-                                ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
+                                if ($out['status'] == 1) {
+                                    if ($is_stock == 1) {
+                                        //库存品,待办数据推给库管
+                                        $uids = Db::name('user_role')
+                                            ->where(['is_del' => 0, 'roleid' => config('app.wsm_cgder_role'), 'status' => 1])
+                                            ->column('uid');
+                                        ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
+                                            "order_type" => 'CKD',
+                                            "order_code" => $outCode,//出库单号
+                                            "order_id" => $ou,
+                                            "order_status" => $out['status'],
+                                            "before_status" => 0,
+                                            'holder_id' => $data['apply_id'],
+                                            'handle_user_list' => implode(',', $uids),
+                                        ]);
+                                    } else {
+                                        //非库存品推给供应商负责人
+                                        $supp = Db::name('supplier')
+                                            ->field('person,personid')
+                                            ->where('code', $ct['supplierNo'])
+                                            ->findOrEmpty();
+                                        ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
+                                            "order_type" => 'CKD',
+                                            "order_code" => $outCode,//出库单号
+                                            "order_id" => $ou,
+                                            "order_status" => $out['status'],
+                                            "before_status" => 0,
+                                            'holder_id' => $data['apply_id'],
+                                            'wait_id' => $supp['personid'],
+                                            'wait_name' => $supp['person'],
+                                        ]);
+                                    }
+
+
+                                }else ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
                                     "order_type" => 'CKD',
                                     "order_code" => $outCode,//出库单号
                                     "order_id" => $ou,