cqpCow 2 years ago
parent
commit
58661a27d0
1 changed files with 6 additions and 89 deletions
  1. 6 89
      app/Service/FyySqlServerService.php

+ 6 - 89
app/Service/FyySqlServerService.php

@@ -332,7 +332,7 @@ class FyySqlServerService extends Service
             "cbmemo"=> "",
             "cfree1"=> $data['technology_name'],
             "cfree2"=> $data['wood_name'],
-            "cdefine28" => $data['technology_material']
+            "cdefine28" => $data['technology_material'],
         ];
         $post = [
             "password"=>"cloud@123456",
@@ -394,6 +394,10 @@ class FyySqlServerService extends Service
                     "iunitcost"=>$val['iunitcost'] * 0.95,
                     "iprice"=>$val['iunitcost'] * 0.95 * $val['iquantity'],
                     "cbmemo"=>"",
+                    "cfree1"=> $val['cfree1'],
+                    "cfree2"=> $val['cfree2'],
+                    "cdefine28" => $val['technology_material'],
+                    "cdefine30" => $val['process_mark'],
                 ];
             }
             $post_tmp = [
@@ -417,7 +421,7 @@ class FyySqlServerService extends Service
                     "cwhcode"=>$main_tmp['cwhcode'],
                     "cdepcode"=>$main_tmp['cdepcode'],
                     "ccuscode"=>$main_tmp['cuscode'],
-                    "crdcode"=>'',
+                    "crdcode"=>'202',
                     "cmemo"=> '',
                     "cdefine10" => $main_tmp['customer_name'], //客户名称
                     "bodys"=>$bodys_tmp,
@@ -434,93 +438,6 @@ class FyySqlServerService extends Service
         return [true,''];
     }
 
-//    public function U8Rdrecord32Save($data,$bredvouch = 0){
-//        if(! empty($this->error)) return [false,$this->error];
-//        date_default_timezone_set("PRC");
-//
-//        //获取包装单内数据
-//        $box = $this->getBoxData($data);
-//        if(empty($box)) return [false,'包装单不能为空!'];
-//
-//        //获取发货单的数据
-//        $return = $this->getDataFromDispatchList(array_column($box,'cSOCode'));
-//        if(empty($return)) return [false,'没有找到发货单!'];
-//
-//        //组织发货单的数据
-//        $map = [];
-//        foreach ($return as $value){
-//            $map[$value['cSOCode']][] = $value;
-//        }
-//
-//        $detail = [];
-//        foreach ($box as $value){
-//            if(! isset($map[$value['cSOCode']])) {
-//                return [false,'包装单内销售订单号:' . $value['cSOCode'] .'没有找到发货单!'];
-//            }
-//            $is_flag = 0;
-//            foreach ($map[$value['cSOCode']] as $m){
-//                if($value['cinvcode'] == $m['cinvcode'] && $value['cfree1'] == $m['cfree1'] && $value['cfree2'] == $m['cfree2']) {
-//                    $is_flag = 1;
-//                    $m['iquantity'] = $value['iquantity'];
-//                    $detail[$m['cSOCode']][] = $m;
-//                }
-//            }
-//            if(! $is_flag) return [false,'包装单内销售订单号:' . $value['cSOCode'] .'产品:' . $value['cinvcode'] . $value['cfree1'] . $value['cfree2'] . '在发货单中不存在!'];
-//        }
-//
-//        foreach ($detail as $value){
-//            $main_tmp = $value[0];
-//            foreach ($value as $val){
-//                $bodys_tmp[] = [
-//                    "idlsid"=>$val['idlsid'],
-//                    "cdlcode"=>"",
-//                    "dlrowno"=>"",
-//                    "cbdlcode"=>"",
-//                    "cinvcode"=>$val['cinvcode'],
-//                    "cposition"=>$val['cposition'],
-//                    "cbatch"=>$val['cbatch'],
-//                    "iquantity"=>$val['iquantity'],
-//                    "inum"=>$val['iquantity'],
-//                    "iinvexchrate"=>$value['iinvexchrate'],
-//                    "iunitcost"=>"",
-//                    "iprice"=>"",
-//                    "cbmemo"=>"",
-//                ];
-//            }
-//            $post_tmp = [
-//                "password"=>"cloud@123456",
-//                "entity"=>"U8Rdrecord32Save",
-//                "login"=>[
-//                    "sAccID"=> $this->sAccID,
-//                    "sDate"=> date("Y-m-d"),
-//                    "sServer"=> '127.0.0.1',
-//                    "sUserID"=> $this->sUserID,
-//                    "sSerial"=> "",
-//                    "sPassword"=> $this->sPassword
-//                ],
-//                "data"=>[
-//                    "ccode"=>'',
-//                    "ddate"=>date("Y-m-d"),
-//                    "cmaker"=>$this->sUserID,
-//                    "dnmaketime"=> date("Y-m-d"),
-//                    "IsExamine"=>true,
-//                    "bredvouch"=> $bredvouch,
-//                    "cwhcode"=>"02",
-//                    "cdepcode"=>"06",
-//                    "crdcode"=>"102",
-//                    "cmemo"=> '',
-//                    "cdefine10" => $main_tmp['customer_name'], //客户名称
-//                    "bodys"=>$bodys_tmp
-//                ]
-//            ];
-//
-//            $return = $this->post_helper($this->url,json_encode($post_tmp), ['Content-Type:application/json']);
-//            if(! $return['flag']) return [false,$return['msg']];
-//        }
-//
-//        return [true,''];
-//    }
-
     public function getBoxData($data){
         $boxData = BoxDetail::from('box_detail as a')
             ->leftJoin('sale_orders_product as b','b.id','a.top_id')