|
|
@@ -23,6 +23,7 @@ use App\Http\Requests\AndroidGateRequest;
|
|
|
use App\Http\Requests\OrderDelivering;
|
|
|
use App\Jobs\BatchTaskJob;
|
|
|
use App\Jobs\CacheShelfTaskJob;
|
|
|
+use App\Jobs\CalculationArrivedManNumJob;
|
|
|
use App\Jobs\OrderCreateInstantBill;
|
|
|
use App\Jobs\OrderCreateWaybill;
|
|
|
use App\Jobs\SettlementBillReportJob;
|
|
|
@@ -137,10 +138,11 @@ class TestController extends Controller
|
|
|
{
|
|
|
try {
|
|
|
return call_user_func([$this, $method], $request);
|
|
|
- }catch (\BadMethodCallException $e){
|
|
|
+ } catch (\BadMethodCallException $e) {
|
|
|
dd("方法不存在");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @param $wave
|
|
|
* @return string
|
|
|
@@ -168,39 +170,40 @@ class TestController extends Controller
|
|
|
}
|
|
|
return $wms_status;
|
|
|
}
|
|
|
+
|
|
|
public function assignBatch()
|
|
|
{
|
|
|
$code = \request("code");
|
|
|
- $batches = Batch::query()->where("code",$code)->get();
|
|
|
- if (!$batches->count()){
|
|
|
- $wave = DB::connection("oracle")->selectOne(DB::raw("select * from DOC_WAVE_HEADER where WAVENO = ?"),[$code]);
|
|
|
- if (!$wave){
|
|
|
+ $batches = Batch::query()->where("code", $code)->get();
|
|
|
+ if (!$batches->count()) {
|
|
|
+ $wave = DB::connection("oracle")->selectOne(DB::raw("select * from DOC_WAVE_HEADER where WAVENO = ?"), [$code]);
|
|
|
+ if (!$wave) {
|
|
|
dd("FLUX无波次");
|
|
|
}
|
|
|
$owner = app("OwnerService")->codeGetOwner($wave->customerid);
|
|
|
$obj = [
|
|
|
"wms_status" => $this->wms_status($wave),
|
|
|
- "wms_type"=>$wave->descr,
|
|
|
- "created_at"=>date("Y-m-d H:i:s"),
|
|
|
- "wms_created_at"=>$wave->addtime,
|
|
|
- "updated_at"=>$wave->edittime,
|
|
|
- "owner_id"=>$owner->id,
|
|
|
+ "wms_type" => $wave->descr,
|
|
|
+ "created_at" => date("Y-m-d H:i:s"),
|
|
|
+ "wms_created_at" => $wave->addtime,
|
|
|
+ "updated_at" => $wave->edittime,
|
|
|
+ "owner_id" => $owner->id,
|
|
|
];
|
|
|
- $wave = Batch::query()->where("code",$code)->first();
|
|
|
- if (!$wave){
|
|
|
+ $wave = Batch::query()->where("code", $code)->first();
|
|
|
+ if (!$wave) {
|
|
|
$obj["code"] = $code;
|
|
|
$wave = Batch::query()->create($obj);
|
|
|
- }else{
|
|
|
- Batch::query()->where("code",$code)->update($obj);
|
|
|
+ } else {
|
|
|
+ Batch::query()->where("code", $code)->update($obj);
|
|
|
}
|
|
|
- $ordernos = array_column(DB::connection("oracle")->select(DB::raw("select orderno from DOC_WAVE_DETAILS where WAVENO = ?"),[$code]),"orderno");
|
|
|
- Order::query()->whereIn("code",$ordernos)->update([
|
|
|
- "batch_id"=>$wave->id
|
|
|
+ $ordernos = array_column(DB::connection("oracle")->select(DB::raw("select orderno from DOC_WAVE_DETAILS where WAVENO = ?"), [$code]), "orderno");
|
|
|
+ Order::query()->whereIn("code", $ordernos)->update([
|
|
|
+ "batch_id" => $wave->id
|
|
|
]);
|
|
|
- Order::query()->with(["batch","bin"])->whereIn("code",$ordernos)->get()->each(function ($order){
|
|
|
- if (!$order->bin){
|
|
|
- $bin = DB::connection("oracle")->selectOne(DB::raw("select seqno from DOC_WAVE_DETAILS where waveno = ? and orderno = ?"),[$order->batch->code,$order->code]);
|
|
|
- if ($bin){
|
|
|
+ Order::query()->with(["batch", "bin"])->whereIn("code", $ordernos)->get()->each(function ($order) {
|
|
|
+ if (!$order->bin) {
|
|
|
+ $bin = DB::connection("oracle")->selectOne(DB::raw("select seqno from DOC_WAVE_DETAILS where waveno = ? and orderno = ?"), [$order->batch->code, $order->code]);
|
|
|
+ if ($bin) {
|
|
|
OrderBin::query()->create([
|
|
|
'order_id' => $order->id,
|
|
|
'number' => $bin->seqno,
|
|
|
@@ -208,10 +211,11 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- $batches = Batch::query()->where("code",$code)->get();
|
|
|
+ $batches = Batch::query()->where("code", $code)->get();
|
|
|
}
|
|
|
app("BatchService")->assignTasks($batches);
|
|
|
}
|
|
|
+
|
|
|
private function i3()
|
|
|
{
|
|
|
$taskItem = new TaskItem();
|
|
|
@@ -223,13 +227,14 @@ class TestController extends Controller
|
|
|
];
|
|
|
$taskItem->attributes = [
|
|
|
"orderLineNo" => "1",
|
|
|
- "skuLineNo" => "1",
|
|
|
- "sku" => "TEST3",
|
|
|
- "lotNum" => "LOT1792011",
|
|
|
- "logisticNumber"=> "极兔",
|
|
|
+ "skuLineNo" => "1",
|
|
|
+ "sku" => "TEST3",
|
|
|
+ "lotNum" => "LOT1792011",
|
|
|
+ "logisticNumber" => "极兔",
|
|
|
];
|
|
|
return (array)$taskItem->get();
|
|
|
}
|
|
|
+
|
|
|
private function i2()
|
|
|
{
|
|
|
$taskItem = new TaskItem();
|
|
|
@@ -241,13 +246,14 @@ class TestController extends Controller
|
|
|
];
|
|
|
$taskItem->attributes = [
|
|
|
"orderLineNo" => "1",
|
|
|
- "skuLineNo" => "1",
|
|
|
- "sku" => "TEST1",
|
|
|
- "lotNum" => "LOT179201",
|
|
|
- "logisticNumber"=> "圆通",
|
|
|
+ "skuLineNo" => "1",
|
|
|
+ "sku" => "TEST1",
|
|
|
+ "lotNum" => "LOT179201",
|
|
|
+ "logisticNumber" => "圆通",
|
|
|
];
|
|
|
return (array)$taskItem->get();
|
|
|
}
|
|
|
+
|
|
|
private function i1()
|
|
|
{
|
|
|
$taskItem = new TaskItem();
|
|
|
@@ -259,13 +265,14 @@ class TestController extends Controller
|
|
|
];
|
|
|
$taskItem->attributes = [
|
|
|
"orderLineNo" => "1",
|
|
|
- "skuLineNo" => "1",
|
|
|
- "sku" => "TEST",
|
|
|
- "lotNum" => "LOT17920",
|
|
|
- "logisticNumber"=> "顺丰",
|
|
|
+ "skuLineNo" => "1",
|
|
|
+ "sku" => "TEST",
|
|
|
+ "lotNum" => "LOT17920",
|
|
|
+ "logisticNumber" => "顺丰",
|
|
|
];
|
|
|
return (array)$taskItem->get();
|
|
|
}
|
|
|
+
|
|
|
private function t1()
|
|
|
{
|
|
|
$task = new Task();
|
|
|
@@ -276,7 +283,7 @@ class TestController extends Controller
|
|
|
"customer" => "幼岚",
|
|
|
];
|
|
|
$task->type = Task::TOTAL_PICKING;
|
|
|
- $task->storages = [["type"=>"1A_container"]];
|
|
|
+ $task->storages = [["type" => "1A_container"]];
|
|
|
$task->items = [
|
|
|
$this->i1(),
|
|
|
$this->i2(),
|
|
|
@@ -284,26 +291,29 @@ class TestController extends Controller
|
|
|
];
|
|
|
return $task->get();
|
|
|
}
|
|
|
+
|
|
|
use Signature;
|
|
|
+
|
|
|
private static $delayedHour = 48;
|
|
|
+
|
|
|
public function test(Request $request)
|
|
|
{
|
|
|
$delayedDateTime = "2021-10-26 00:00:00";
|
|
|
dd(\App\ReceiveRecord::query()
|
|
|
- ->where("record_at",">",$delayedDateTime)
|
|
|
- ->where("delayed",0)
|
|
|
- ->whereIn("logistic_number",RejectedBill::query()->select("logistic_number_return")
|
|
|
- ->where("created_at",">",$delayedDateTime)->whereIn("logistic_number_return",
|
|
|
+ ->where("record_at", ">", $delayedDateTime)
|
|
|
+ ->where("delayed", 0)
|
|
|
+ ->whereIn("logistic_number", RejectedBill::query()->select("logistic_number_return")
|
|
|
+ ->where("created_at", ">", $delayedDateTime)->whereIn("logistic_number_return",
|
|
|
\App\ReceiveRecord::query()->select("logistic_number")
|
|
|
- ->where("record_at",">",$delayedDateTime)
|
|
|
- ->where("delayed",0)))->sql());
|
|
|
+ ->where("record_at", ">", $delayedDateTime)
|
|
|
+ ->where("delayed", 0)))->sql());
|
|
|
$ser = new \App\Http\Controllers\api\thirdPart\syrius\producer\OrderController();
|
|
|
|
|
|
$code = "W211025000233";
|
|
|
$s = new SyriusTaskService();
|
|
|
- $orders = Order::query()->with(["owner:id,name","batch:id,code","orderCommodities.commodity.barcodes"])
|
|
|
- ->whereIn("batch_id",Batch::query()->select("id")->where("code",$code))->get();
|
|
|
- foreach ($orders as $order){
|
|
|
+ $orders = Order::query()->with(["owner:id,name", "batch:id,code", "orderCommodities.commodity.barcodes"])
|
|
|
+ ->whereIn("batch_id", Batch::query()->select("id")->where("code", $code))->get();
|
|
|
+ foreach ($orders as $order) {
|
|
|
$task = $s->formatTask($order);
|
|
|
dump($ser->createOrder($task)->body());
|
|
|
}
|
|
|
@@ -311,6 +321,7 @@ class TestController extends Controller
|
|
|
$a = new \App\Http\Controllers\api\thirdPart\syrius\producer\OrderController();
|
|
|
dd($a->createOrder($this->t1())->body());
|
|
|
}
|
|
|
+
|
|
|
public function test1()
|
|
|
{
|
|
|
$a = new \App\Http\Controllers\api\thirdPart\syrius\producer\OrderController();
|
|
|
@@ -318,8 +329,6 @@ class TestController extends Controller
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private function t2()
|
|
|
{
|
|
|
$task = new Task();
|
|
|
@@ -330,13 +339,14 @@ class TestController extends Controller
|
|
|
$task->attributes = [
|
|
|
"customer" => "幼岚",
|
|
|
];
|
|
|
- $task->storages = [["serialNo"=>"1635055429594424"]];
|
|
|
+ $task->storages = [["serialNo" => "1635055429594424"]];
|
|
|
$task->items = [
|
|
|
$this->p1(),
|
|
|
$this->p2(),
|
|
|
];
|
|
|
return $task->get();
|
|
|
}
|
|
|
+
|
|
|
private function p1()
|
|
|
{
|
|
|
$taskItem = new TaskItem();
|
|
|
@@ -347,15 +357,16 @@ class TestController extends Controller
|
|
|
"G11-133-1",
|
|
|
];
|
|
|
$taskItem->attributes = [
|
|
|
- "storageSerialNo"=>"1635055429594424",
|
|
|
+ "storageSerialNo" => "1635055429594424",
|
|
|
"orderLineNo" => "1",
|
|
|
- "skuLineNo" => "1",
|
|
|
- "sku" => "TEST1",
|
|
|
- "lotNum" => "LOT179201",
|
|
|
- "logisticNumber"=> "圆通",
|
|
|
+ "skuLineNo" => "1",
|
|
|
+ "sku" => "TEST1",
|
|
|
+ "lotNum" => "LOT179201",
|
|
|
+ "logisticNumber" => "圆通",
|
|
|
];
|
|
|
return (array)$taskItem->get();
|
|
|
}
|
|
|
+
|
|
|
private function p2()
|
|
|
{
|
|
|
$taskItem = new TaskItem();
|
|
|
@@ -366,12 +377,12 @@ class TestController extends Controller
|
|
|
"G11-099-1",
|
|
|
];
|
|
|
$taskItem->attributes = [
|
|
|
- "storageSerialNo"=>"1635055429594424",
|
|
|
+ "storageSerialNo" => "1635055429594424",
|
|
|
"orderLineNo" => "1",
|
|
|
- "skuLineNo" => "1",
|
|
|
- "sku" => "TEST",
|
|
|
- "lotNum" => "LOT17920",
|
|
|
- "logisticNumber"=> "顺丰",
|
|
|
+ "skuLineNo" => "1",
|
|
|
+ "sku" => "TEST",
|
|
|
+ "lotNum" => "LOT17920",
|
|
|
+ "logisticNumber" => "顺丰",
|
|
|
];
|
|
|
return (array)$taskItem->get();
|
|
|
}
|
|
|
@@ -490,25 +501,26 @@ sql;
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
- public function syncOrderPackage(){
|
|
|
- ini_set('memory_limit','500M');
|
|
|
+ public function syncOrderPackage()
|
|
|
+ {
|
|
|
+ ini_set('memory_limit', '500M');
|
|
|
ini_set('max_execution_time', 0);
|
|
|
$orderPackingSummary = OracleDocOrderPackingSummary::query()
|
|
|
- ->where('editTime','>=','2021-09-11 12:00:00')
|
|
|
- ->where('editTime','<=','2021-09-12 12:40:00')
|
|
|
+ ->where('editTime', '>=', '2021-09-11 12:00:00')
|
|
|
+ ->where('editTime', '<=', '2021-09-12 12:40:00')
|
|
|
->get();
|
|
|
|
|
|
$orderPackingSummary_chunk = $orderPackingSummary->chunk(200);
|
|
|
foreach ($orderPackingSummary_chunk as $orderPackingSummarys) {
|
|
|
foreach ($orderPackingSummarys as $orderPackingSummary) {
|
|
|
- $orderPackage = OrderPackage::query()->where('logistic_number',$orderPackingSummary->traceid)->first();
|
|
|
+ $orderPackage = OrderPackage::query()->where('logistic_number', $orderPackingSummary->traceid)->first();
|
|
|
$orderPackage->update([
|
|
|
- 'uploaded_to_wms'=> true,
|
|
|
- 'weight'=>$orderPackingSummary->grossweight,
|
|
|
- 'length'=>$orderPackingSummary->length,
|
|
|
- 'width'=>$orderPackingSummary->width,
|
|
|
- 'height'=>$orderPackingSummary->height,
|
|
|
- 'weighed_at'=>$orderPackingSummary->edittime
|
|
|
+ 'uploaded_to_wms' => true,
|
|
|
+ 'weight' => $orderPackingSummary->grossweight,
|
|
|
+ 'length' => $orderPackingSummary->length,
|
|
|
+ 'width' => $orderPackingSummary->width,
|
|
|
+ 'height' => $orderPackingSummary->height,
|
|
|
+ 'weighed_at' => $orderPackingSummary->edittime
|
|
|
]);
|
|
|
dispatch(new WeightUpdateInstantBill($orderPackage));
|
|
|
}
|
|
|
@@ -520,8 +532,8 @@ sql;
|
|
|
{
|
|
|
/** @var OrderPackageService $service */
|
|
|
$service = app('OrderPackageService');
|
|
|
- return $service->collectUpload([
|
|
|
- '75601803541125'
|
|
|
+ return $service->collectUpload([
|
|
|
+ '75601803541125'
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -558,14 +570,14 @@ sql;
|
|
|
// $startDate = $this->getDate();
|
|
|
$startDate = '2021-09-25 13:23:14';
|
|
|
$diffDay = 1; // 天数
|
|
|
- for($i = 0;$i<=$diffDay;$i++){
|
|
|
+ for ($i = 0; $i <= $diffDay; $i++) {
|
|
|
$endDate = Carbon::parse($startDate)->addDays(1)->toDateTimeString();
|
|
|
- $doc_asn_headers = $this->getDocAsnHeader($startDate,$endDate);
|
|
|
+ $doc_asn_headers = $this->getDocAsnHeader($startDate, $endDate);
|
|
|
// if (count($doc_asn_headers)>0){
|
|
|
// $this->syncStores($doc_asn_headers);
|
|
|
// $this->syncDate($endDate);
|
|
|
// }
|
|
|
- dump($startDate,$endDate);
|
|
|
+ dump($startDate, $endDate);
|
|
|
$startDate = $endDate;
|
|
|
}
|
|
|
$this->clearCache();
|
|
|
@@ -578,12 +590,11 @@ sql;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- public function getDocAsnHeader($startDate,$endDate)
|
|
|
+ public function getDocAsnHeader($startDate, $endDate)
|
|
|
{
|
|
|
return OracleDOCASNHeader::query()
|
|
|
->with(['asnType', 'asnStatus'])
|
|
|
- ->select('asnno','asnstatus','asntype','addtime','edittime','customerid','notes','warehouseid','asnreference3','asnreference2')
|
|
|
+ ->select('asnno', 'asnstatus', 'asntype', 'addtime', 'edittime', 'customerid', 'notes', 'warehouseid', 'asnreference3', 'asnreference2')
|
|
|
->where('EditTime', '>=', $startDate)
|
|
|
->where('EditTime', '<=', $endDate)
|
|
|
->whereColumn('EditTime', '<>', 'addTime')
|
|
|
@@ -591,13 +602,15 @@ sql;
|
|
|
->get();
|
|
|
}
|
|
|
|
|
|
- public function getDate(){
|
|
|
- return ValueStore::query()->where('name','asn_last_updated_sync_at')->value('value');
|
|
|
+ public function getDate()
|
|
|
+ {
|
|
|
+ return ValueStore::query()->where('name', 'asn_last_updated_sync_at')->value('value');
|
|
|
}
|
|
|
|
|
|
- public function syncStores($doc_asn_headers){
|
|
|
+ public function syncStores($doc_asn_headers)
|
|
|
+ {
|
|
|
$service = new StoreService();
|
|
|
- $service->createStore($doc_asn_headers,"update");
|
|
|
+ $service->createStore($doc_asn_headers, "update");
|
|
|
$service->updateStore($doc_asn_headers);
|
|
|
$service->createStoreRejected($doc_asn_headers);
|
|
|
unset($doc_asn_headers);
|
|
|
@@ -613,6 +626,7 @@ sql;
|
|
|
'value' => $date,
|
|
|
]);
|
|
|
}
|
|
|
+
|
|
|
public function clearCache()
|
|
|
{
|
|
|
$service = new StoreService();
|
|
|
@@ -622,6 +636,7 @@ sql;
|
|
|
// 清空保存 ans 号的栈
|
|
|
// 清除 更新时间 开始 结束
|
|
|
}
|
|
|
+
|
|
|
public function updateStoreItem()
|
|
|
{
|
|
|
ini_set('max_execution_time', 0);
|
|
|
@@ -645,10 +660,12 @@ sql;
|
|
|
|
|
|
public function init_SettlementBillReportTask()
|
|
|
{
|
|
|
- $this->dispatch(new SettlementBillReportJob('2021-09-01',[]));
|
|
|
+ $this->dispatch(new SettlementBillReportJob('2021-09-01', []));
|
|
|
}
|
|
|
- public function test2(){
|
|
|
- $source_file ="E:\OneDrive\桌面\工作目录\文件库\\5.jpg";
|
|
|
+
|
|
|
+ public function test2()
|
|
|
+ {
|
|
|
+ $source_file = "E:\OneDrive\桌面\工作目录\文件库\\5.jpg";
|
|
|
|
|
|
$img = ImageCreateFromJpeg($source_file);
|
|
|
imagecolortransparent($img);//将某个颜色设置成透明色
|
|
|
@@ -662,27 +679,31 @@ sql;
|
|
|
const FILE_NOT_FOUND = '-1';
|
|
|
const FILE_EXTNAME_ILLEGAL = '-2';
|
|
|
|
|
|
- public function run($src1, $src2) {
|
|
|
- if(!is_file($src1) || !is_file($src2)) exit(self::FILE_NOT_FOUND);
|
|
|
+ public function run($src1, $src2)
|
|
|
+ {
|
|
|
+ if (!is_file($src1) || !is_file($src2)) exit(self::FILE_NOT_FOUND);
|
|
|
$hash1 = $this->getHashValue($src1);
|
|
|
$hash2 = $this->getHashValue($src2);
|
|
|
- if(strlen($hash1) !== strlen($hash2)) return false;
|
|
|
+ if (strlen($hash1) !== strlen($hash2)) return false;
|
|
|
$count = 0;
|
|
|
$len = strlen($hash1);
|
|
|
- for($i = 0; $i < $len; $i++) if($hash1[$i] !== $hash2[$i]){
|
|
|
+ for ($i = 0; $i < $len; $i++) if ($hash1[$i] !== $hash2[$i]) {
|
|
|
$count++;
|
|
|
}
|
|
|
dd($count);
|
|
|
return $count <= 10 ? true : false;
|
|
|
}
|
|
|
|
|
|
- public function getImage($file) {
|
|
|
+ public function getImage($file)
|
|
|
+ {
|
|
|
$extname = pathinfo($file, PATHINFO_EXTENSION);
|
|
|
- if(!in_array($extname, ['jpg','jpeg','png','gif'])) exit(self::FILE_EXTNAME_ILLEGAL);
|
|
|
- $img = call_user_func('imagecreatefrom'. ( $extname == 'jpg' ? 'jpeg' : $extname ) , $file);
|
|
|
+ if (!in_array($extname, ['jpg', 'jpeg', 'png', 'gif'])) exit(self::FILE_EXTNAME_ILLEGAL);
|
|
|
+ $img = call_user_func('imagecreatefrom' . ($extname == 'jpg' ? 'jpeg' : $extname), $file);
|
|
|
return $img;
|
|
|
}
|
|
|
- public function getHashValue($file) {
|
|
|
+
|
|
|
+ public function getHashValue($file)
|
|
|
+ {
|
|
|
$w = 32;
|
|
|
$h = 32;
|
|
|
$img = imagecreatetruecolor($w, $h);
|
|
|
@@ -692,7 +713,7 @@ sql;
|
|
|
imagedestroy($src);
|
|
|
$total = 0;
|
|
|
$array = array();
|
|
|
- for( $y = 0; $y < $h; $y++) {
|
|
|
+ for ($y = 0; $y < $h; $y++) {
|
|
|
for ($x = 0; $x < $w; $x++) {
|
|
|
$rgb = imagecolorat($img, $x, $y);
|
|
|
$gray = $rgb & 0xFF;
|
|
|
@@ -701,7 +722,7 @@ sql;
|
|
|
($rgb >> 16) & 0xFF,
|
|
|
$rgb & 0xFF,
|
|
|
]);*/
|
|
|
- if(!isset($array[$y])) $array[$y] = array();
|
|
|
+ if (!isset($array[$y])) $array[$y] = array();
|
|
|
$array[$y][$x] = $gray;
|
|
|
$total += $gray;
|
|
|
}
|
|
|
@@ -709,8 +730,8 @@ sql;
|
|
|
imagedestroy($img);
|
|
|
$average = intval($total / ($w * $h * 2));
|
|
|
$hash = '';
|
|
|
- for($y = 0; $y < $h; $y++) {
|
|
|
- for($x = 0; $x < $w; $x++) {
|
|
|
+ for ($y = 0; $y < $h; $y++) {
|
|
|
+ for ($x = 0; $x < $w; $x++) {
|
|
|
$hash .= ($array[$y][$x] >= $average) ? '1' : '0';
|
|
|
}
|
|
|
}
|
|
|
@@ -720,17 +741,17 @@ sql;
|
|
|
|
|
|
public function sortTransferStatus()
|
|
|
{
|
|
|
- $orderPackage = OrderPackage::query()->where('logistic_number','75601831068018')->first();
|
|
|
+ $orderPackage = OrderPackage::query()->where('logistic_number', '75601831068018')->first();
|
|
|
app('OrderPackageService')->sortOrderPackageTransferStatus($orderPackage);
|
|
|
dd($orderPackage);
|
|
|
}
|
|
|
|
|
|
public function clear_work_space()
|
|
|
{
|
|
|
- \App\LaborApply::query()->truncate();
|
|
|
+// \App\LaborApply::query()->truncate();
|
|
|
|
|
|
LaborCompanyDispatch::query()->truncate();
|
|
|
-
|
|
|
+//
|
|
|
\App\LaborCompanyDispatchDetail::query()->truncate();
|
|
|
}
|
|
|
|
|
|
@@ -738,12 +759,12 @@ sql;
|
|
|
{
|
|
|
$last_start_key = config('sync.order_sync.cache_prefix.last_start_at');
|
|
|
$last_end_key = config('sync.order_sync.cache_prefix.last_end_at');
|
|
|
- Cache::put($last_start_key,Carbon::make('2021-10-12 06:23:37'));
|
|
|
- Cache::put($last_end_key,Carbon::make('2021-10-12 06:23:38'));
|
|
|
- ValueStore::query()->where('name','order_last_created_sync_at')->update(['value' => '2021-10-12 06:23:37']);
|
|
|
- ValueStore::query()->where('name','order_last_updated_sync_at')->update(['value' => '2021-10-12 06:23:37']);
|
|
|
- ValueStore::query()->where('name','last_order_sync_task_start_at')->update(['value' => '2021-10-12 06:23:37']);
|
|
|
- ValueStore::query()->where('name','last_order_sync_task_end_at')->update(['value' => '2021-10-12 06:23:38']);
|
|
|
+ Cache::put($last_start_key, Carbon::make('2021-10-12 06:23:37'));
|
|
|
+ Cache::put($last_end_key, Carbon::make('2021-10-12 06:23:38'));
|
|
|
+ ValueStore::query()->where('name', 'order_last_created_sync_at')->update(['value' => '2021-10-12 06:23:37']);
|
|
|
+ ValueStore::query()->where('name', 'order_last_updated_sync_at')->update(['value' => '2021-10-12 06:23:37']);
|
|
|
+ ValueStore::query()->where('name', 'last_order_sync_task_start_at')->update(['value' => '2021-10-12 06:23:37']);
|
|
|
+ ValueStore::query()->where('name', 'last_order_sync_task_end_at')->update(['value' => '2021-10-12 06:23:38']);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -752,7 +773,7 @@ sql;
|
|
|
$code = \request("code");
|
|
|
$service = new OracleDOCOrderHeaderService();
|
|
|
$orderService = new OrderService();
|
|
|
- $orderHeaders = $service->getQuery()->where('DOC_Order_Header.WaveNo',$code)->get();
|
|
|
+ $orderHeaders = $service->getQuery()->where('DOC_Order_Header.WaveNo', $code)->get();
|
|
|
$orderService->syncOrderByWMSOrderHeaders($orderHeaders);
|
|
|
app("OrderCommodityService")->syncOrderCommodity($orderHeaders);
|
|
|
dd('同步完成');
|
|
|
@@ -764,4 +785,13 @@ sql;
|
|
|
$service = app('OwnerStoreOutFeeReportService');
|
|
|
$service->recordReport(null, [2]);
|
|
|
}
|
|
|
+
|
|
|
+ public function init_labor_company_dispatch()
|
|
|
+ {
|
|
|
+ $dispatches = LaborCompanyDispatch::all();
|
|
|
+ foreach ($dispatches as $dispatch) {
|
|
|
+ $dispatch->warehouse_id = $dispatch->laborCompany->warehouse_id ?? null;
|
|
|
+ $dispatch->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|