|
|
@@ -48,7 +48,6 @@ use App\OrderPackageCommodities;
|
|
|
use App\OrderPackageCountingRecord;
|
|
|
use App\OrderTracking;
|
|
|
use App\Owner;
|
|
|
-use App\OwnerFeeDetail;
|
|
|
use App\OwnerPriceOperation;
|
|
|
use App\OwnerPriceOperationItem;
|
|
|
use App\Package;
|
|
|
@@ -74,7 +73,6 @@ use App\Services\OracleDocAsnHerderService;
|
|
|
use App\Services\OracleDOCOrderHeaderService;
|
|
|
use App\Services\OracleDocWaveDetailService;
|
|
|
use App\Services\OrderCommodityService;
|
|
|
-use App\Services\OrderFreezeService;
|
|
|
use App\Services\OrderPackageReceivedSyncService;
|
|
|
use App\Services\OrderPackageService;
|
|
|
use App\Services\OrderService;
|
|
|
@@ -87,7 +85,6 @@ 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;
|
|
|
@@ -134,52 +131,12 @@ class TestController extends Controller
|
|
|
}
|
|
|
|
|
|
public function zzd(){
|
|
|
- dd(substr("2021-01-28",0,7) == date("Y-m"));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public function orderFreeze()
|
|
|
- {
|
|
|
- $freezeOrders = [];
|
|
|
- $orders = Order::query()->whereBetween("updated_at",["2021-01-29 09:00:00","2021-01-29 14:00:00"])
|
|
|
- ->get()->toArray();
|
|
|
- foreach ($orders as $param){
|
|
|
- if ($this->isFreeze($param))$freezeOrders[] = $param["code"];
|
|
|
- }
|
|
|
- $this->pushWMS($freezeOrders);
|
|
|
- }
|
|
|
-
|
|
|
- private function isFreeze($param)
|
|
|
- {
|
|
|
- $status = ['分配完成','创建订单','拣货完成','播种完成'];
|
|
|
- if (array_search($param["wms_status"],$status)===false)return false;
|
|
|
-
|
|
|
- $service = new OrderFreezeService();
|
|
|
- $pools = $service->getFreezes();
|
|
|
- foreach ($pools as $pool){
|
|
|
- if ($pool["thawed_at"] && Carbon::parse($pool["thawed_at"])->lte(Carbon::today()))continue;
|
|
|
- if ($pool["logistic_id"]!=$param["logistic_id"])continue;
|
|
|
- if ($pool["province_name"] && (mb_strpos($param["province"],$pool["province_name"]) === false))continue;
|
|
|
- if ($pool["city_name"] && (mb_strpos($param["city"],$pool["city_name"]) === false))continue;
|
|
|
- if ($pool["district_name"] && (mb_strpos($param["district"],$pool["district_name"]) === false))continue;
|
|
|
- if ($pool["town_name"] && (mb_strpos($param["address"],$pool["town_name"]) === false))continue;
|
|
|
- if ($pool["street_name"] && (mb_strpos($param["address"],$pool["street_name"]) === false))continue;
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- private function pushWMS($freezeOrders)
|
|
|
- {
|
|
|
- if (!$freezeOrders)return;
|
|
|
- $where = "''";
|
|
|
- foreach ($freezeOrders as $f)$where .= ",'{$f}'";
|
|
|
- $edit = date("Y-m-d H:i:s");
|
|
|
- $sql = <<<sql
|
|
|
-UPDATE DOC_ORDER_HEADER SET edittime = TO_DATE('{$edit}','yyyy-mm-dd hh24:mi:ss'),releasestatus = 'H',waveno='*',notes = CASE WHEN notes IS NULL THEN '停运' ELSE notes||',停运' END where ORDERNO in ({$where})
|
|
|
-sql;
|
|
|
- DB::connection("oracle")->update($sql);
|
|
|
- LogService::log(__METHOD__,"订单同步-自动冻结",$sql);
|
|
|
+ $update = [
|
|
|
+ ["id","wms_status","remark","updated_at"],
|
|
|
+ ["id"=>6,"wms_status"=>"完全收货",
|
|
|
+ "remark"=>"01.[ALLBLU]普通波次","updated_at"=>"2021-01-27 08:58:53"]
|
|
|
+ ];
|
|
|
+ dd(app(BatchUpdateService::class)->batchUpdate("batches",$update));
|
|
|
}
|
|
|
|
|
|
public function syncWeight()
|
|
|
@@ -337,7 +294,7 @@ sql;
|
|
|
|
|
|
function tlog(Request $request)
|
|
|
{
|
|
|
- dd((User::class)::query()->first());
|
|
|
+ app('LogService')->log(__METHOD__, 'cczdelme' . __FUNCTION__, json_encode($request->all()), null);
|
|
|
}
|
|
|
|
|
|
function setCache(Request $request)
|
|
|
@@ -355,7 +312,9 @@ sql;
|
|
|
|
|
|
function t1(Request $request)
|
|
|
{
|
|
|
-// StationTask::query()->create(['status'=>'待处理']);
|
|
|
+ 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')"));
|
|
|
}
|
|
|
|
|
|
function packageT(Request $request)
|