|
@@ -760,7 +760,7 @@ class TestService extends Service
|
|
|
"cExch_Name" => "人民币",
|
|
"cExch_Name" => "人民币",
|
|
|
"cSource" => "库存",
|
|
"cSource" => "库存",
|
|
|
"cBusType" => "普通采购",
|
|
"cBusType" => "普通采购",
|
|
|
- "cMemo" => "接口生成",
|
|
|
|
|
|
|
+ "cMemo" => $data['cMemo'] ?? "接口生成",
|
|
|
"dDate" => date("Y-m-d"),
|
|
"dDate" => date("Y-m-d"),
|
|
|
],
|
|
],
|
|
|
"iBody" => $inventoryEntry
|
|
"iBody" => $inventoryEntry
|
|
@@ -787,49 +787,67 @@ class TestService extends Service
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//检验单(不是用友的检验单 所以不是参照)生成其他入库单
|
|
//检验单(不是用友的检验单 所以不是参照)生成其他入库单
|
|
|
- public function otherInByZj($data){
|
|
|
|
|
- $record = $data['record'];
|
|
|
|
|
- $payload = $data['payload'];
|
|
|
|
|
- $id = $record['u8_id'];
|
|
|
|
|
- $num = $payload['hg_not_quantity'];
|
|
|
|
|
-
|
|
|
|
|
- //获取单据 检验单
|
|
|
|
|
- $service = new U8ThirtyPartyDatabaseServerService();
|
|
|
|
|
- list($status, $order) = $service->getJyOrder($id);
|
|
|
|
|
- if(! $status) return [false, $order];
|
|
|
|
|
-
|
|
|
|
|
- //u8 token
|
|
|
|
|
- list($status, $msg) = $this->getToken();
|
|
|
|
|
|
|
+ public function otherInByZj($data, $common_array){
|
|
|
|
|
+ // u8 token 获取
|
|
|
|
|
+ list($status, $msg) = $this->getToken($common_array);
|
|
|
if(! $status) return [false, $msg];
|
|
if(! $status) return [false, $msg];
|
|
|
|
|
+ $title = $common_array['title'];
|
|
|
|
|
+
|
|
|
|
|
+ $baseData = [
|
|
|
|
|
+ "iRowNo" => 1,
|
|
|
|
|
+ "cInvCode" => $data['material_code'] ?? '',
|
|
|
|
|
+ "cBatch" => $data['batch'] ?? null,
|
|
|
|
|
+ "iinvexchrate" => null,
|
|
|
|
|
+ "iQuantity" => $data['quantity'], // 数量
|
|
|
|
|
+ "dMadeDate" => $order['made_date'] ?? null, // 生产日期
|
|
|
|
|
+ "dVDate" => $order['valid_date'] ?? null,
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ if ($common_array['site'] == "LFMY") {
|
|
|
|
|
+ // 朗峰结构 (cdefine28 - cdefine33)
|
|
|
|
|
+ $extData = [
|
|
|
|
|
+ 'cdefine28' => $data['brand_name'] ?? null,
|
|
|
|
|
+ 'cdefine29' => $data['safe'] ?? null,
|
|
|
|
|
+ 'cdefine30' => $data['decor'] ?? null,
|
|
|
|
|
+ 'cdefine31' => $data['craft_type_code'] ?? null,
|
|
|
|
|
+ 'cdefine32' => $data['decor_b'] ?? null,
|
|
|
|
|
+ 'cdefine33' => $data['craft_type_code_b'] ?? null,
|
|
|
|
|
+ ];
|
|
|
|
|
+ } elseif ($common_array['site'] == "HCLT") {
|
|
|
|
|
+ // 恒昌结构 (cfree + cdefine22/23 + cdefine28-31)
|
|
|
|
|
+ $extData = [
|
|
|
|
|
+ 'cfree1' => $data['customer_brand'] ?? null,
|
|
|
|
|
+ 'cfree2' => $data['color'] ?? null,
|
|
|
|
|
+ 'cdefine22' => $data['plan_no'] ?? null,
|
|
|
|
|
+ 'cdefine23' => $data['contract_no'] ?? null,
|
|
|
|
|
+ 'cdefine28' => $data['technical_require'] ?? null,
|
|
|
|
|
+ 'cdefine29' => $data['quality_require'] ?? null,
|
|
|
|
|
+ 'cdefine30' => $data['package_require'] ?? null,
|
|
|
|
|
+ 'cdefine31' => $data['shipping_mark'] ?? null,
|
|
|
|
|
+ ];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $extData = [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $inventoryEntry = array_merge($baseData, $extData);
|
|
|
|
|
|
|
|
$tmp = [
|
|
$tmp = [
|
|
|
"Inum" => "OtherIn",
|
|
"Inum" => "OtherIn",
|
|
|
"Data" => [
|
|
"Data" => [
|
|
|
"iHead" => [
|
|
"iHead" => [
|
|
|
"IsVerify" => true,
|
|
"IsVerify" => true,
|
|
|
- "cWhCode" => "53", // 成品不良品库
|
|
|
|
|
- "cRdCode" => '0109', // 入库类别 其他入库
|
|
|
|
|
- "cDepCode" => '', // 部门
|
|
|
|
|
- "cMemo" => "接口生成",
|
|
|
|
|
|
|
+ "cWhCode" => $data['warehouse_code'] ?? "",
|
|
|
|
|
+ "cRdCode" => $data['cRdCode'] ?? null, // 入库类别
|
|
|
|
|
+ "cDepCode" => null, // 部门
|
|
|
|
|
+ "cSource" => "库存",
|
|
|
|
|
+ "cBusType" => "其他入库",
|
|
|
|
|
+ "cMemo" => $data['cMemo'] ?? "接口生成",
|
|
|
"dDate" => date("Y-m-d"),
|
|
"dDate" => date("Y-m-d"),
|
|
|
],
|
|
],
|
|
|
- "iBody" => []
|
|
|
|
|
|
|
+ "iBody" => $inventoryEntry
|
|
|
]
|
|
]
|
|
|
];
|
|
];
|
|
|
- //一个检验单只有一行
|
|
|
|
|
- $tmp["Data"]["iBody"][] = [
|
|
|
|
|
- "iRowNo" => 1,
|
|
|
|
|
- "cInvCode" => $order['CINVCODE'] ?? '',
|
|
|
|
|
- "cAssUnit" => $order['CUNITID'] ?? '',
|
|
|
|
|
- "cPosition" => $order['cPosition'] ?? '',
|
|
|
|
|
- "cBatch" => $order['CBATCH'] ?? '',
|
|
|
|
|
- "iinvexchrate" => $order['FCHANGRATE'] ?? 0,
|
|
|
|
|
- "iQuantity" => $num, // 数量
|
|
|
|
|
- "dMadeDate" => $order['DPRODATE'] ?? '', // 生产日期
|
|
|
|
|
- "dVDate" => $order['DVDATE'] ?? '',
|
|
|
|
|
- 'cFree1' => $order['CFREE1'] ?? null,
|
|
|
|
|
- 'cFree2' => $order['CFREE2'] ?? null,
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+
|
|
|
$final_data = [$tmp];
|
|
$final_data = [$tmp];
|
|
|
|
|
|
|
|
//调用所需
|
|
//调用所需
|
|
@@ -841,10 +859,11 @@ class TestService extends Service
|
|
|
$url = $host . "/api/OtherIn/Add";
|
|
$url = $host . "/api/OtherIn/Add";
|
|
|
|
|
|
|
|
$json = json_encode($final_data);
|
|
$json = json_encode($final_data);
|
|
|
- list($status, $result) = $this->post_helper1($url, $json, $header, 30);
|
|
|
|
|
|
|
+ list($status, $result) = $this->post_helper($url, json_encode($json), $header, 60, $title . '生成其他入库单');
|
|
|
|
|
+
|
|
|
if(! $status) return [false, $result];
|
|
if(! $status) return [false, $result];
|
|
|
|
|
|
|
|
- if(! isset($result['code'])) return [false, '其他入库单生成并审核失败'];
|
|
|
|
|
|
|
+ if(! isset($result['code'])) return [false, '其他入库单生成失败,请重试'];
|
|
|
if($result['code'] != 0) return [false, $result['msg']];
|
|
if($result['code'] != 0) return [false, $result['msg']];
|
|
|
|
|
|
|
|
return [true, ''];
|
|
return [true, ''];
|