|
|
@@ -25,6 +25,7 @@ use App\Jobs\WeightUpdateInstantBill;
|
|
|
use App\LaborCompanyDispatch;
|
|
|
use App\LaborReport;
|
|
|
use App\LaborReportStatus;
|
|
|
+use App\Logistic;
|
|
|
use App\MaterialBox;
|
|
|
use App\MaterialBoxModel;
|
|
|
use App\Notifications\RoutineNotification;
|
|
|
@@ -45,6 +46,7 @@ use App\OwnerFeeLogistic;
|
|
|
use App\OwnerFeeOperation;
|
|
|
use App\OwnerFeeOperationDetail;
|
|
|
use App\OwnerFeeStorage;
|
|
|
+use App\OwnerPriceExpress;
|
|
|
use App\OwnerPriceOperation;
|
|
|
use App\OrderPackageCountingRecord;
|
|
|
use App\ProcurementCheckSheet;
|
|
|
@@ -85,6 +87,7 @@ use Carbon\CarbonPeriod;
|
|
|
use Decimal\Decimal;
|
|
|
use Doctrine\DBAL\Exception;
|
|
|
use Firebase\JWT\JWT;
|
|
|
+use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
use Illuminate\Database\Eloquent\HigherOrderBuilderProxy;
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
@@ -118,7 +121,7 @@ class TestController extends Controller
|
|
|
$this->data["active_test"] = "active";
|
|
|
}
|
|
|
|
|
|
- public function method(AndroidGateRequest $request, $method)
|
|
|
+ public function method(Request $request, $method)
|
|
|
{
|
|
|
try {
|
|
|
return call_user_func([$this, $method], $request);
|
|
|
@@ -197,195 +200,15 @@ class TestController extends Controller
|
|
|
}
|
|
|
app("BatchService")->assignTasks($batches);
|
|
|
}
|
|
|
- public function test(AndroidGateRequest $request)
|
|
|
+ public function test()
|
|
|
{
|
|
|
- dd(Waybill::query()->with(["order:id,address","logistic:id,name","amountUnit:id,name"])
|
|
|
- ->select("id","order_id","logistic_id","amount_unit_id",
|
|
|
- "waybill_number","destination","recipient","recipient_mobile",
|
|
|
- "carrier_bill","warehouse_weight","carrier_weight","inquire_tel",
|
|
|
- "warehouse_weight_other","carrier_weight_other","amount","origination")
|
|
|
- ->paginate(15)->append(["carrier_name","amount_unit_name","remove_relation"])->toJson());
|
|
|
- $url = config('api_logistic.collectUpload.ZTO.prod.url');
|
|
|
- $xAppKey = config('api_logistic.collectUpload.ZTO.prod.x-appKey');
|
|
|
- $appSecret = config('api_logistic.collectUpload.ZTO.prod.appSecret');
|
|
|
- $appId = config('api_logistic.collectUpload.ZTO.prod.appId');
|
|
|
- dd(env('APP_ENV'));
|
|
|
- //中通接口请求body
|
|
|
- $collectUploadDTOS = [[
|
|
|
- 'billCode' => "75811463670235",
|
|
|
- 'weight' => 0,
|
|
|
- 'appId' => $appId,
|
|
|
- 'importDate' => now()->toDateTimeString(),
|
|
|
- ]];
|
|
|
- $body = json_encode([
|
|
|
- 'collectUploadDTOS' => $collectUploadDTOS,
|
|
|
- ], JSON_UNESCAPED_UNICODE);
|
|
|
- $data_digest = base64_encode(md5($body . $appSecret, TRUE));
|
|
|
- $headers = [
|
|
|
- 'Content-Type' => 'application/json; charset=UTF-8',
|
|
|
- 'x-companyid' => $xAppKey,
|
|
|
- 'x-datadigest' => $data_digest,
|
|
|
- ];
|
|
|
- dd(Http::withHeaders($headers)->withBody($body, 'application/json')->post($url)->body());
|
|
|
-
|
|
|
- $stores = Store::query()->whereIn("id",[490692,492252,492405,493259,491290,491758,492252,492989,493522,
|
|
|
- 496079,490702,491173,491780,493522,488622,490891,491020,491173,493308,489448,491020,491184,493573,493977,
|
|
|
- 496105,492086,493714,493977,496118,492593,492592,492591,492590,493011,493979,490721,492192,493429,493978,
|
|
|
- 496106,490721,491460,493165,496114,489319,489436,490703,491190,493957,496115,496114,489436,491147,
|
|
|
- 491695,492395,490711,491461,491695,492079,494533,496099,496096,490711,491458,491797,492244,
|
|
|
- 492422,496098,496097,496100,491458,491798,493572,493752,490443,491457,492394,493531,493572,491687,
|
|
|
- 492394,492968,493782,490431,490994,493782,488570,489103,490616,490994,493966,489862,490616,
|
|
|
- 490629,495645,490629,491455,488793])->get();
|
|
|
- $this->dispatch(new StoreCreateInstantBill($stores));
|
|
|
- dd(1);
|
|
|
-
|
|
|
- /** @var StationTaskMaterialBox $stationTaskMaterialBox */
|
|
|
- $stationTaskMaterialBox = app("StorageService")->createWarehousingTask($stationService->getStation_byType('立库')["id"],$station->materialBox->id);
|
|
|
- app("CacheShelfService")->lightUp($station->code,'3','0',['title'=>"等待机器人拿走,请勿操作"]);
|
|
|
- Cache::forever("CACHE_SHELF_OCCUPANCY_{$station->id}",true);
|
|
|
- dd($ForeignHaiRoboticsService->putBinToStore_fromCacheShelf($stationTaskMaterialBox, $station));
|
|
|
- $user = Auth::user();
|
|
|
- $remark = "zengjunlj";
|
|
|
- $ownerName = 'zengjunlj' ?? '';
|
|
|
- $clientCode = 'zengjunljljlj' ?? '';
|
|
|
- $msg = $user["name"]."建立了新工单<br/>".$ownerName.":".$clientCode."<br/>".$remark;
|
|
|
- NotificationService::SingleRegister($msg,$clientCode,"订单管理-问题件");
|
|
|
- dd(1);
|
|
|
- $seeLog = SeeLog::query()->find(9);
|
|
|
- Notification::send(Auth::user(),new RoutineNotification($seeLog->toArray()));
|
|
|
- dd(1);
|
|
|
- Broadcast::channel('notification', function ($user, $id) {
|
|
|
- return (int) $user->id === (int) $id;
|
|
|
- });
|
|
|
- dd(1);
|
|
|
- Notification::send(Auth::user(),new RoutineNotification($seeLog->toArray()));
|
|
|
- dd(1);
|
|
|
- $username = config('database.connections.oracle.username');
|
|
|
- $password = config('database.connections.oracle.password');
|
|
|
- $host = config('database.connections.oracle.host');
|
|
|
- $service_name = config('database.connections.oracle.service_name');
|
|
|
- $conn = oci_connect($username, $password, $host . '/' . $service_name,"utf8");
|
|
|
- $sql = <<<sql
|
|
|
-BEGIN
|
|
|
- SPSO_HardAllocation_Process('WH01','Allocation','By OrderNO',
|
|
|
- null,'SO21090100007','0',null,
|
|
|
- 'zhouzhendong',:CODE);
|
|
|
-END;
|
|
|
-sql;
|
|
|
-
|
|
|
- $stmt = oci_parse($conn, $sql);
|
|
|
- $code = "";
|
|
|
- oci_bind_by_name($stmt, ':CODE', $code,300);
|
|
|
- oci_execute($stmt);
|
|
|
- oci_close($conn);
|
|
|
- dd($code);
|
|
|
- //
|
|
|
-
|
|
|
- $no = "SO21090900001";
|
|
|
-
|
|
|
-
|
|
|
- $db = DB::connection("oracle");
|
|
|
- //$order = $db->selectOne(DB::raw("select * from DOC_ORDER_HEADER where orderno = ?"),[$no]);
|
|
|
- dd($db->select($sql,[
|
|
|
- ]));
|
|
|
- $db->select("CALL SPSO_HardAllocation_Process(?,'Allocation','By OrderNO',null,?,'0',null,'zhouzhendong',@code)",[
|
|
|
- $order->warehouseid,$no
|
|
|
- ]);
|
|
|
- //SPSO_HardAllocation_Process
|
|
|
- dd($db->selectOne("select @code"));
|
|
|
- $date = "2021-09-14 15:47:00";
|
|
|
- dispatch(new TestJob("1"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("2"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("3"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("4"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("5"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("6"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("7"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("8"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("9"))->delay(Carbon::parse($date));
|
|
|
- dispatch(new TestJob("10"))->delay(Carbon::parse($date));
|
|
|
- dd(1);
|
|
|
-
|
|
|
-
|
|
|
- Station::query()->where("station_type_id", 5)->update(["status" => 1]);
|
|
|
- Cache::forget("CACHE_SHELF_AVAILABLE");
|
|
|
- $station = ["HAIB1-01-01", "HAIB1-02-01"];
|
|
|
- $material = ["IDE0001824", "IDE0001740", "IDE0002710"];
|
|
|
- Station::query()->whereIn("code", $station)->update(["status" => 0]);
|
|
|
- $stations = Station::query()->whereIn("code", $station)->get();
|
|
|
- $materials = MaterialBox::query()->whereIn("code", $material)->get();
|
|
|
- $dateTime = date("Y-m-d H:i:s");
|
|
|
- $task1 = StationTaskMaterialBox::query()->create([
|
|
|
- 'station_id' => $stations[0]->id,
|
|
|
- 'material_box_id' => $materials[0]->id,
|
|
|
- 'station_task_batch_id' => 1,
|
|
|
- 'status' => '待处理'
|
|
|
- ]);
|
|
|
- $task2 = StationTaskMaterialBox::query()->create([
|
|
|
- 'station_id' => $stations[1]->id,
|
|
|
- 'material_box_id' => $materials[1]->id,
|
|
|
- 'station_task_batch_id' => 1,
|
|
|
- 'status' => '待处理'
|
|
|
- ]);
|
|
|
- $task3 = StationTaskMaterialBox::query()->create([
|
|
|
- 'station_id' => 6,
|
|
|
- 'material_box_id' => $materials[2]->id,
|
|
|
- 'station_task_batch_id' => 1,
|
|
|
- 'status' => '待处理'
|
|
|
- ]);
|
|
|
- TaskTransaction::query()->insert([[
|
|
|
- "doc_code" => "test",
|
|
|
- "bar_code" => "test",
|
|
|
- "to_station_id" => $stations[0]->id,
|
|
|
- "material_box_id" => $materials[0]->id,
|
|
|
- "task_id" => $task1->id,
|
|
|
- "commodity_id" => 505012,//XUNI03
|
|
|
- "amount" => 1,
|
|
|
- "type" => "出库",
|
|
|
- "status" => 0,
|
|
|
- "mark" => 2,
|
|
|
- "bin_number" => 1,
|
|
|
- "created_at" => $dateTime,
|
|
|
- "updated_at" => $dateTime,
|
|
|
- ], [
|
|
|
- "doc_code" => "test",
|
|
|
- "bar_code" => "test",
|
|
|
- "to_station_id" => $stations[1]->id,
|
|
|
- "material_box_id" => $materials[1]->id,
|
|
|
- "task_id" => $task2->id,
|
|
|
- "commodity_id" => 505012,//XUNI03
|
|
|
- "amount" => 1,
|
|
|
- "type" => "出库",
|
|
|
- "status" => 0,
|
|
|
- "mark" => 2,
|
|
|
- "bin_number" => 1,
|
|
|
- "created_at" => $dateTime,
|
|
|
- "updated_at" => $dateTime,
|
|
|
- ], [
|
|
|
- "doc_code" => "test",
|
|
|
- "bar_code" => "test",
|
|
|
- "to_station_id" => 6,
|
|
|
- "material_box_id" => $materials[2]->id,
|
|
|
- "task_id" => $task3->id,
|
|
|
- "commodity_id" => 505012,//XUNI03
|
|
|
- "amount" => 1,
|
|
|
- "type" => "出库",
|
|
|
- "status" => 3,
|
|
|
- "mark" => 2,
|
|
|
- "bin_number" => 1,
|
|
|
- "created_at" => $dateTime,
|
|
|
- "updated_at" => $dateTime,
|
|
|
- ]]);
|
|
|
- $foreignHaiRoboticsService = new ForeignHaiRoboticsService();
|
|
|
- $toLocation = collect($station);
|
|
|
- $taskMaterialBoxes = collect([$task1, $task2]);
|
|
|
- $foreignHaiRoboticsService->
|
|
|
- fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架', 20, false);
|
|
|
- foreach ($toLocation as $index => $value) {
|
|
|
- app("CacheShelfService")->lightUp($value, '3', '0', ["title" => "机器人取箱中,禁止操作"]);
|
|
|
- Cache::forever("CACHE_SHELF_OCCUPANCY_{$stations[$index]->id}", true);
|
|
|
- }
|
|
|
- app("StationService")->locationOccupyMulti($toLocation->toArray());
|
|
|
+ $st = '[{"taskMode":1,"bins":[{"taskCode":"102876_1632099648.1379","binCode":"IDE0000686","fromLocCode":"BIN-IN1","toLocCode":""}],"groupCode":"_1632099648.1379","priority":10,"sequenceFlag":1}]';
|
|
|
+ $st = json_decode($st,true);
|
|
|
+ $st[0]["sequenceFlag"] = 0;
|
|
|
+ dd(json_encode($st));
|
|
|
+ $order = Order::query()->find(4367620);
|
|
|
+ $s = new OrderService();
|
|
|
+ $s->createInstantBill($order);
|
|
|
}
|
|
|
|
|
|
public function update_order_packages_is_manual_update()
|
|
|
@@ -656,7 +479,7 @@ sql;
|
|
|
|
|
|
public function init_SettlementBillReportTask()
|
|
|
{
|
|
|
- $this->dispatch(new SettlementBillReportJob('2021-08-01',[]));
|
|
|
+ $this->dispatch(new SettlementBillReportJob('2021-09-01',[]));
|
|
|
}
|
|
|
public function test2(){
|
|
|
$source_file ="E:\OneDrive\桌面\工作目录\文件库\\5.jpg";
|