cqpCow 2 ani în urmă
părinte
comite
143e9eb17a

+ 1 - 1
app/Jobs/ProcessDataJob.php

@@ -167,7 +167,7 @@ class ProcessDataJob implements ShouldQueue
         //队列名
         $job = $this->jobs[$this->type];
 
-        if ($failureCount < 2) {
+        if ($failureCount < 1) {
             // 将任务重新放回队列
             self::dispatch($this->data,$this->user,$this->type)->onQueue($job)->delay(now()->addSeconds(2));
         } else {

+ 2 - 1
app/Service/FyyOrderService.php

@@ -251,7 +251,7 @@ class FyyOrderService extends Service
             ]);
 
             foreach ($data['box_data'] as $value){
-                SaleOrdersProduct::where('id',$data['top_id'])->update([
+                SaleOrdersProduct::where('id',$value['top_id'])->update([
                     'shipment_num' => DB::raw("shipment_num + {$value['num']}"),
                 ]);
             }
@@ -355,6 +355,7 @@ class FyyOrderService extends Service
                         'technology_name' => $cfree1,
                         'wood_name' => $cfree2,
                         'num' => $n,
+                        'technology_material' => $value['technology_material']
                     ];
                 }
 

+ 7 - 4
app/Service/FyySqlServerService.php

@@ -372,11 +372,13 @@ class FyySqlServerService extends Service
 
         $new = [];
         foreach ($data as $value){
-            $new[$value['id']][] = $value;
+            $keys = $value['id'] . $value['cwhcode'];
+            $new[$keys][] = $value;
         }
 
         foreach ($new as $value){
             $main_tmp = $value[0];
+            $bodys_tmp = [];
             foreach ($value as $val){
                 $bodys_tmp[] = [
                     "idlsid"=>$val['idlsid'],
@@ -389,8 +391,8 @@ class FyySqlServerService extends Service
                     "iquantity"=>$val['iquantity'],
                     "inum"=>$val['inum'],
                     "iinvexchrate"=> $val['iinvexchrate'] ?? 0,
-                    "iunitcost"=>$val['iunitcost'],
-                    "iprice"=>$val['imoney'],
+                    "iunitcost"=>$val['iunitcost'] * 0.95,
+                    "iprice"=>$val['iunitcost'] * 0.95 * $val['iquantity'],
                     "cbmemo"=>"",
                 ];
             }
@@ -414,6 +416,7 @@ class FyySqlServerService extends Service
                     "bredvouch"=> $bredvouch,
                     "cwhcode"=>$main_tmp['cwhcode'],
                     "cdepcode"=>$main_tmp['cdepcode'],
+                    "ccuscode"=>$main_tmp['cuscode'],
                     "crdcode"=>'',
                     "cmemo"=> '',
                     "cdefine10" => $main_tmp['customer_name'], //客户名称
@@ -542,7 +545,7 @@ class FyySqlServerService extends Service
         }
         if(! empty($data['order_no'])) $model->where('a.cSOcode',$data['order_no']);
 
-        $message = $model->select('a.cDLCode as cdlcode','a.DLID as id','a.cDefine10 as customer_name','a.cSOCode as csocode','a.cDepCode as cdepcode','a.cCusCode as cuscode','b.iDLsID as idlsid','b.cWhCode as cwhcode','b.cInvCode as cinvcode','b.cInvName as product_title','b.cFree1 as cfree1','b.cFree2 as cfree2','b.cPosition as cposition','b.cBatch as cbatch','b.iQuantity as iquantity','b.iNum as inum','b.iInvExchRate as iinvexchrate','b.fOutQuantity as out_quantity','b.iUnitPrice as iunitcost','b.iMoney as imoney')
+        $message = $model->select('a.cDLCode as cdlcode','a.DLID as id','a.cDefine10 as customer_name','a.cSOCode as csocode','a.cDepCode as cdepcode','a.cCusCode as cuscode','b.iDLsID as idlsid','b.cWhCode as cwhcode','b.cInvCode as cinvcode','b.cInvName as product_title','b.cFree1 as cfree1','b.cFree2 as cfree2','b.cPosition as cposition','b.cBatch as cbatch','b.iQuantity as iquantity','b.iNum as inum','b.iInvExchRate as iinvexchrate','b.fOutQuantity as out_quantity','b.iUnitPrice as iunitcost','b.iMoney as imoney','b.cDefine28 as technology_material')
             ->get()->toArray();
 
         if(! empty($message)){