|
|
@@ -34,6 +34,7 @@ use App\OwnerFeeOperationDetail;
|
|
|
use App\OwnerFeeStorage;
|
|
|
use App\OwnerPriceOperation;
|
|
|
use App\OrderPackageCountingRecord;
|
|
|
+use App\Process;
|
|
|
use App\ProcurementCheckSheet;
|
|
|
use App\RejectedBill;
|
|
|
use App\RejectedBillItem;
|
|
|
@@ -97,69 +98,25 @@ class TestController extends Controller
|
|
|
{
|
|
|
return call_user_func([$this, $method], $request);
|
|
|
}
|
|
|
- private function valFormat($val):?string
|
|
|
- {
|
|
|
- if ($val!==null){
|
|
|
- $ret = date("Y-m-d H:i:s",strtotime($val))===(string)$val;
|
|
|
- if ($ret)$val = "to_date('".$val."','yyyy-mm-dd hh24:mi:ss')";
|
|
|
- else $val = "'".$val."'";
|
|
|
- }else $val = "null";
|
|
|
- return $val;
|
|
|
- }
|
|
|
- public function test1($task,$amount){
|
|
|
- DB::connection("oracle")->beginTransaction();
|
|
|
- try {
|
|
|
- $columns = '';
|
|
|
- $values = '';
|
|
|
- foreach ($task as $key => $val) {
|
|
|
- if (Str::upper($key) == 'TASKID_SEQUENCE') {
|
|
|
- $taskMax = DB::connection("oracle")->selectOne(DB::raw("select MAX(TASKID_SEQUENCE) maxseq from TSK_TASKLISTS where taskid = ?"), [$task->taskid]);
|
|
|
- $val = $taskMax->maxseq + 1;
|
|
|
- }
|
|
|
- if (Str::upper($key) == 'FMQTY' || Str::upper($key) == 'FMQTY_EACH'
|
|
|
- || Str::upper($key) == 'PLANTOQTY' || Str::upper($key) == 'PLANTOQTY_EACH') {
|
|
|
- $val -= $amount;
|
|
|
- $task->$key = $amount;
|
|
|
- }
|
|
|
- $columns .= $key . ",";
|
|
|
- $values .= $this->valFormat($val) . ",";
|
|
|
- }
|
|
|
- $columns = mb_substr($columns, 0, -1);
|
|
|
- $values = mb_substr($values, 0, -1);
|
|
|
- $sql = <<<sql
|
|
|
- INSERT INTO TSK_TASKLISTS({$columns}) VALUES({$values})
|
|
|
-sql;
|
|
|
- dd($sql);
|
|
|
- } catch (\Exception $e) {
|
|
|
- dd($e);
|
|
|
- }
|
|
|
- }
|
|
|
public function test(){
|
|
|
DB::beginTransaction();
|
|
|
try {
|
|
|
+ foreach (DB::connection("was_test")->table("processes")->where("created_at",">=","2021-09-11 11:00:00")
|
|
|
+ ->get() as $item){
|
|
|
+ $val = Process::query()->where("code",$item->code)->first();
|
|
|
+ if (!$val){
|
|
|
+ unset($item->id);
|
|
|
+
|
|
|
+ Process::query()->create((array)$item);
|
|
|
+ }
|
|
|
+ }
|
|
|
DB::commit();
|
|
|
- dd("OK");
|
|
|
}catch (\Exception $e){
|
|
|
DB::rollBack();
|
|
|
dd($e->getMessage());
|
|
|
}
|
|
|
+ dd(1);
|
|
|
TaskTransaction::query()->where("id",">=",280)->delete();
|
|
|
- /*$a= new StorageService();
|
|
|
- $a->clearTask(["HAIB1-01-01"]);
|
|
|
- $task = StationTaskMaterialBox::query()->find(90233);
|
|
|
- $station = Station::query()->find(11);
|
|
|
- $foreignHaiRoboticsService = new ForeignHaiRoboticsService();
|
|
|
- $foreignHaiRoboticsService->putBinToStore_fromCacheShelf($task, $station);
|
|
|
- dd(1);*/
|
|
|
- /*$batchService = new BatchService();
|
|
|
- $batches = Batch::query()->where("id",171829)->get();
|
|
|
- $batchService->assignTasks($batches);
|
|
|
- dd();*/
|
|
|
- /*TaskTransaction::query()->where("id",">=",277)->delete();
|
|
|
- StationTaskMaterialBox::query()->whereIn("id",[89685,89686,89687])->delete();
|
|
|
- app("CacheShelfService")->_stationCacheLightOff("HAIB1-01-01");//灭灯
|
|
|
- app("CacheShelfService")->_stationCacheLightOff("HAIB1-02-01");//灭灯
|
|
|
- dd(1);*/
|
|
|
Station::query()->where("station_type_id", 5)->update(["status" => 1]);
|
|
|
Cache::forget("CACHE_SHELF_AVAILABLE");
|
|
|
$station = ["HAIB1-01-01", "HAIB1-02-01"];
|