|
|
@@ -19,6 +19,7 @@ use App\Console\Commands\WasSyncWmsAsnInformation;
|
|
|
use App\Exceptions\ErrorException;
|
|
|
use App\Events\CancelOrder;
|
|
|
use App\Events\SendEmailEvent;
|
|
|
+use App\Exceptions\Exception;
|
|
|
use App\Http\Requests\ForeignHaiRobotic_taskUpdateRequest;
|
|
|
use App\Http\Requests\TestAaRequest;
|
|
|
use App\Imports\OrderTrackingImport;
|
|
|
@@ -87,10 +88,11 @@ use App\Services\ShopService;
|
|
|
use App\Services\StoreService;
|
|
|
use App\Services\WarehouseService;
|
|
|
use App\StationRuleBatch;
|
|
|
+use App\StationTask;
|
|
|
use App\Store;
|
|
|
use App\StationTaskBatch;
|
|
|
use App\StoreCheckingReceiveItem;
|
|
|
-use App\StoreItems;
|
|
|
+use App\StoreItem;
|
|
|
use App\Unit;
|
|
|
use App\User;
|
|
|
use App\ValueStore;
|
|
|
@@ -291,7 +293,7 @@ sql;
|
|
|
|
|
|
function tlog(Request $request)
|
|
|
{
|
|
|
- app('LogService')->log(__METHOD__, 'cczdelme' . __FUNCTION__, json_encode($request->all()), null);
|
|
|
+ dd((User::class)::query()->first());
|
|
|
}
|
|
|
|
|
|
function setCache(Request $request)
|
|
|
@@ -309,9 +311,7 @@ sql;
|
|
|
|
|
|
function t1(Request $request)
|
|
|
{
|
|
|
- throw new ErrorException('eeeff');
|
|
|
- DB::connection('oracle')->update(DB::raw("update BAS_SKU set HAZARD_FLAG= 'N' where SKU= '13564151055'"));
|
|
|
-// DB::connection('oracle')->update(DB::raw("UPDATE DOC_ORDER_HEADER SET notes = CASE WHEN notes IS NULL THEN '停运' ELSE notes||',停运' END where ORDERNO in ('','SO190628000050','SO190628000001')"));
|
|
|
+// StationTask::query()->create(['status'=>'待处理']);
|
|
|
}
|
|
|
|
|
|
function packageT(Request $request)
|
|
|
@@ -803,8 +803,20 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
|
|
|
public function output2()
|
|
|
{
|
|
|
- dump(Cache::get('aa'));
|
|
|
- Cache::put('aa', '2223', 5);
|
|
|
+ StationTaskBatch::query()->insert([[
|
|
|
+ 'batch_id' => 41414351,
|
|
|
+ 'station_id' => 4131251,
|
|
|
+ 'station_task_batch_type_id' => 1231231251,
|
|
|
+ 'status' => '待处理',
|
|
|
+ 'created_at' => now(),
|
|
|
+ 'updated_at' => now(),
|
|
|
+ ]]);
|
|
|
+// (new StationTaskBatch([
|
|
|
+// 'batch_id' => 41414324,
|
|
|
+// 'station_id' => 4131224,
|
|
|
+// 'station_task_batch_type_id' => 123123124,
|
|
|
+// 'status' => '待处理'
|
|
|
+// ]))->save();
|
|
|
}
|
|
|
|
|
|
public function usage()
|
|
|
@@ -1069,6 +1081,7 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
|
|
|
public function testSyncOrderTask()
|
|
|
{
|
|
|
+ Cache::flush();
|
|
|
dump('hendle...');
|
|
|
dump((string)Carbon::now());
|
|
|
dump(memory_get_usage() / 1024 / 1024);
|
|
|
@@ -1106,11 +1119,11 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
public function testUpdateSkuNameBarcodeToCommodity_id()
|
|
|
{
|
|
|
$amount = 1000;
|
|
|
- $storeItem = StoreItems::query()->orderByDesc('id')->first();
|
|
|
+ $storeItem = StoreItem::query()->orderByDesc('id')->first();
|
|
|
$sum = $storeItem->id;
|
|
|
$number = ceil($sum / $amount);
|
|
|
for ($i = 0; $i < $number; $i++) {
|
|
|
- $storeItems = StoreItems::query()->with('store')
|
|
|
+ $storeItems = StoreItem::query()->with('store')
|
|
|
->where('id', '>=', $i * $amount)
|
|
|
->where('id', '<', ($i * $amount + $amount))
|
|
|
->get();
|
|
|
@@ -1481,21 +1494,19 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-// public function testNumber()
|
|
|
-// {
|
|
|
-// $asnnos=['ASN2101200684','ASN2101220543','ASN2101220542'];
|
|
|
-// $asnHeaders=OracleDOCASNHeader::query()->whereIn('asnno',$asnnos)->get();
|
|
|
-// /**
|
|
|
-// * @var RejectedBillService $rejectedBillService
|
|
|
-// */
|
|
|
-// $rejectedBillService=app(RejectedBillService::class);
|
|
|
-//
|
|
|
-// $updates = $rejectedBillService->getNeedUpdateCheckedStatusByWms($asnHeaders);
|
|
|
-// app(BatchUpdateService::class)->batchUpdate('rejected_bills', $updates);
|
|
|
-// dump($updates);
|
|
|
-// //$logisticNumberReturn = $rejectedBillService->getLogisticNumberReturn($arr);
|
|
|
-// //$rejectedBills = $rejectedBillService->getRejectedBills($logisticNumberReturn);
|
|
|
-// }
|
|
|
+ public function testCarbon()
|
|
|
+ {
|
|
|
+ $month_begin = date('Y-m-01 00:00:00');
|
|
|
+ dump($month_begin);
|
|
|
+ dd(Carbon::parse($month_begin)->isAfter(Carbon::parse('2020-12-01 00:00:00')));
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testGet()
|
|
|
+ {
|
|
|
+ $service = new OrderService();
|
|
|
+ $count = $service->getCurrentFinishedOrders_byOwnerId(7);
|
|
|
+ dd($count);
|
|
|
+ }
|
|
|
|
|
|
public function updateRejectBillCheckedStatus()
|
|
|
{
|
|
|
@@ -1512,4 +1523,16 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
app(BatchUpdateService::class)->batchUpdate('rejected_bills', $updates);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public function clearCancelledOrder()
|
|
|
+ {
|
|
|
+ $wave_nos = ['W210129000248','W210202000216','W210202000251','W210202000216','W210202000282'];
|
|
|
+ $order_nos = ['SO210129004112' , 'SO210202003333','SO210202003333','SO210202003236','SO210202003247','SO210202003719'];
|
|
|
+ try {
|
|
|
+ OracleDOCWaveDetails::query()->whereIn('WaveNo',$wave_nos)->whereIn('OrderNo', $order_nos)->delete();
|
|
|
+ app('LogService')->log(__CLASS__, __METHOD__, 'Delete OracleDOCWaveDetails' . ' ' . json_encode($order_nos).json_encode($wave_nos));
|
|
|
+ } catch (Exception $e) {
|
|
|
+ app('LogService')->log(__CLASS__, __METHOD__,'Error clearCancelledOrder'.json_encode($order_nos).json_encode($wave_nos));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|