Quellcode durchsuchen

Merge branch 'master' into zzd

# Conflicts:
#	laravel-echo-server.lock
dream vor 5 Jahren
Ursprung
Commit
f90ceb0dbd
48 geänderte Dateien mit 471 neuen und 971 gelöschten Zeilen
  1. 4 6
      app/Console/Commands/BeforeCreateOwnerReport.php
  2. 1 6
      app/Feature.php
  3. 3 2
      app/Http/Controllers/OrderIssueController.php
  4. 123 51
      app/Http/Controllers/PersonnelController.php
  5. 1 5
      app/Http/Controllers/PriceModelController.php
  6. 12 8
      app/Http/Controllers/ProcurementController.php
  7. 10 1
      app/Http/Controllers/TestController.php
  8. 17 20
      app/Http/Controllers/UserDutyCheckController.php
  9. 3 2
      app/Http/Controllers/WaybillPriceModelController.php
  10. 0 1
      app/Http/Controllers/api/thirdPart/flux/WaybillController.php
  11. 12 7
      app/Http/Controllers/api/thirdPart/weixin/ProcurementController.php
  12. 1 2
      app/Imports/ExpressImport.php
  13. 0 1
      app/Jobs/ProcurementEnquiry.php
  14. 13 7
      app/LaborReport.php
  15. 0 2
      app/OwnerPriceOperation.php
  16. 0 1
      app/OwnerPriceOperationItem.php
  17. 2 0
      app/Procurement.php
  18. 4 2
      app/ProcurementQuotation.php
  19. 4 2
      app/Providers/AppServiceProvider.php
  20. 0 1
      app/Services/CommodityBarcodeService.php
  21. 4 5
      app/Services/CommodityService.php
  22. 7 6
      app/Services/ForeignHaiRoboticsService.php
  23. 10 26
      app/Services/LaborReportService.php
  24. 22 38
      app/Services/OwnerPriceOperationService.php
  25. 3 10
      app/Services/StationRuleBatchService.php
  26. 7 7
      app/Services/StationTaskBatchService.php
  27. 5 1
      app/Services/StationTaskCommodityService.php
  28. 2 1
      app/Services/StationTaskMaterialBoxService.php
  29. 1 44
      app/Services/StoreService.php
  30. 1 1
      app/Services/common/QueryService.php
  31. 11 11
      app/UserDutyCheck.php
  32. 1 2
      app/Waybill.php
  33. 3 5
      laravel-echo-server.json
  34. 3 0
      laravel-echo-server.lock
  35. 64 565
      package-lock.json
  36. 0 1
      package.json
  37. 70 70
      resources/lang/cn/validation.php
  38. 1 1
      resources/views/customer/project/area.blade.php
  39. 3 24
      resources/views/customer/project/create.blade.php
  40. 4 1
      resources/views/customer/project/part/_addFeature.blade.php
  41. 1 13
      resources/views/customer/project/part/_operation.blade.php
  42. 0 3
      resources/views/customer/project/part/_three.blade.php
  43. 23 3
      resources/views/personnel/checking-in/createReplenishClock.blade.php
  44. 10 2
      resources/views/procurement/procurement/index.blade.php
  45. 1 0
      resources/views/station/monitor/show.blade.php
  46. 1 1
      resources/views/test.blade.php
  47. 2 2
      tests/webApi/thirdPart/haiq/pickStation.http
  48. 1 1
      webpack.mix.js

+ 4 - 6
app/Console/Commands/BeforeCreateOwnerReport.php

@@ -24,7 +24,6 @@ class BeforeCreateOwnerReport extends Command
     protected $description = 'Create owner report in advance and build cache';
 
 
-    const TTL = 2764800;
     /**
      * Execute the console command.
      *
@@ -43,11 +42,10 @@ class BeforeCreateOwnerReport extends Command
                     "counting_month" => date("Y-m-d"),
                     "created_at"     => $date
                 ];
-                //A:件 B:business C:customer D:date
-                Cache::put(date("Y-m")."|B|".$owner->id,0,self::TTL);
-                Cache::put(date("Y-m")."|C|".$owner->id,0,self::TTL);
-                Cache::put(date("Y-m")."|D|".$owner->id,time(),self::TTL);
-                Cache::put(date("Y-m")."|A|".$owner->id,0,self::TTL);
+                //B:business C:customer D:date
+                Cache::put(date("Y-m")."|B|".$owner->id,0,2764800);
+                Cache::put(date("Y-m")."|C|".$owner->id,0,2764800);
+                Cache::put(date("Y-m")."|D|".$owner->id,time(),2764800);
             }
             OwnerReport::query()->insert($insert);
         }

+ 1 - 6
app/Feature.php

@@ -25,11 +25,9 @@ class Feature extends Model
         5 => "商品备注",  //二级
         6 => "长",       //二级
         7 => "订单备注",
-        10=> "订单商品数",//二级
-        11=> "属性仓",
     ];
     //额外定义 8:商品数量 9:商品
-    const TYPE_NODE = [0,5,6,8,9,10]; //标注二级类型
+    const TYPE_NODE = [0,5,6,8,9]; //标注二级类型
     const MAPPING = [
         "store" => [
             0 => "storeItems.name",
@@ -39,8 +37,6 @@ class Feature extends Model
             7 => "remark",
             8 => "storeItems.amount",
             9 => "storeItems.commodity",
-            10=> "storeItems.total",
-            11=> "warehouse.name",
         ],
         "order" => [
             0 => "packages.commodities.commodity.name",
@@ -53,7 +49,6 @@ class Feature extends Model
             7 => "remark",
             8 => 'packages.commodities.amount',
             9 => 'packages.commodities.commodity',
-            10=> 'packages.commodities.total',
         ]
     ];
 }

+ 3 - 2
app/Http/Controllers/OrderIssueController.php

@@ -577,7 +577,7 @@ class OrderIssueController extends Controller
             '退回单号', '退单商品名','退单商品条码','退单商品数量','是否正品','退单状态','退单备注',
             '操作类型','说明','操作者','情况说明','问题类别',
             '二次订单号','二次承运商','二次运单号','二次商品条码','二次商品名','二次商品数量',
-            '最终状态', '承运商赔偿金额', '承运商快递减免', '宝时赔偿金额', '宝时快递减免','事故责任方','项目责任方'
+            '最终状态', '承运商赔偿金额', '承运商快递减免', '宝时赔偿金额', '宝时快递减免','事故责任方',/*'项目责任方'*/
         ];
         foreach ($order_Issues as $order_issue){
             $order =  $order_issue->order;
@@ -634,6 +634,7 @@ class OrderIssueController extends Controller
             $order_issue->userWorkgroups->each(function ($userWorkgroup)use (&$userWorkgroupsName) {
                 $userWorkgroupsName.=($userWorkgroup->name).",\r\n";
             });
+            if (isset($order_issue->userOwnerGroup->name))$userWorkgroupsName.=$order_issue->userOwnerGroup->name.",\r\n";
             $json[] = [
                 isset($order_issue->created_at) ? str_split($order_issue->created_at,10)[0] :'',       // 登记日期
                 isset($order->created_at) ? str_split($order->created_at,10)[0] :'',             // 创建日期
@@ -686,7 +687,7 @@ class OrderIssueController extends Controller
                 $order_issue->baoshi_indemnity_money,
                 $order_issue->baoshi_express_remission,
                 rtrim($userWorkgroupsName,",\r\n"),
-                $order_issue->userOwnerGroup->name ?? '',
+//                $order_issue->userOwnerGroup->name ?? '',
             ];
         }
         return app(ExportService::class)->json($row,$json,"订单问题件");

+ 123 - 51
app/Http/Controllers/PersonnelController.php

@@ -6,10 +6,12 @@ use App\Events\ExportEvent;
 use App\Events\ImportEvent;
 use App\Events\TeamAuditEvent;
 use App\LaborReport;
+use App\LaborReportStatus;
 use App\ProcessDailyParticipant;
 use App\Services\LaborReportService;
 use App\UserDetail;
 use App\UserDutyCheck;
+use App\UserLabor;
 use App\UserWorkgroup;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Builder;
@@ -34,27 +36,101 @@ class PersonnelController extends Controller
         $checked_at=$request->input('checked_at');
         $type=$request->input('type');
         $remark=$request->input('remark');
-        $userDutyCheck=new UserDutyCheck([
-            'user_id'=>$user_id,
-            'checked_at'=>$checked_at,
-            'type'=>$type,
-            'source'=>'补入',
-        ]);
+        $userWorkGroup=$request->input('userWorkGroup');
         $checkedAtDate=Carbon::parse($checked_at)->format('Y-m-d');
-        $userDutyCheckBefore=UserDutyCheck::where('user_id',$user_id)->where('checked_at','like',$checkedAtDate.'%')->orderBy('id','desc')->first();
-        if ($userDutyCheckBefore['type']=='登入'&&$userDutyCheck->type=='登入')return ['result'=>true,'data'=>'已存在进场记录!'];
-        if ($userDutyCheckBefore['type']=='登出'&&$userDutyCheck->type=='登出')return ['result'=>true,'data'=>'已存在出场记录!'];
-        if ($type=='登出')$userDutyCheck->verify_user_id=Auth::user()['id'];
-        $userDutyCheck->save();
-        app('LogService')->log(__METHOD__,"录入补卡".__FUNCTION__,json_encode($userDutyCheck),Auth::user()['id']);
-        $errorMessage=$this->makeOrUpdateLaborReport($userDutyCheck,$remark);
-        if ($errorMessage)return $errorMessage;
-        return ['success'=>true,'data'=>$userDutyCheck];
+        /** @var LaborReportService $laborReportService */
+        $laborReportService=app(LaborReportService::class);
+        switch ($type) {
+            case '进组':
+              $laborReport=LaborReport::query()->with('userDutyCheck','user.userDetail')
+                  ->where('user_id',$user_id)
+                  ->where('created_at','like',$checkedAtDate.'%')
+                  ->orderBy('id','desc')->first();
+              if ($laborReport && !$laborReport->check_in_at && !$laborReport->user_workgroup_id){ //第一次进组
+                  $laborReport->update([
+                      'check_in_at'=>$checked_at,
+                      'verify_at'=>$checked_at,
+                      'group_user_id'=>Auth::user()['id'],
+                      'user_workgroup_id'=>$userWorkGroup,
+                  ]);
+                  LaborReportStatus::query()->create([
+                      'labor_report_id'=>$laborReport['id'],
+                      'status'=>'已进组',
+                      'created_at'=>$checked_at,
+                  ]);
+                  if ($remark)$laborReportService->addOrUpdateRemark($remark,$laborReport->id);
+                  app('LogService')->log(__METHOD__,"录入进组补卡".__FUNCTION__,json_encode($laborReport),Auth::user()['id']);
+                  return ['success'=>true,'data'=>$laborReport->userDutyCheck];
+              }
+              if ($laborReport && $laborReport->user_workgroup_id==$userWorkGroup) return ['result'=>true,'data'=>'已存在进组记录!'];
+              if ($laborReport && $laborReport->user_workgroup_id!=$userWorkGroup){ //换组情况
+                  if ($laborReport->check_in_at && !$laborReport->check_out_at) return ['result'=>true,'data'=>'该临时工记录还未退组,不可补进组卡(换组)!'];
+                  $laborReportStatus=LaborReportStatus::query()->where('labor_report_id',$laborReport->id)
+                      ->where('status','已退场')->first();
+                  if ($laborReportStatus) return ['result'=>true,'data'=>'该临时工记录已退场,不可补进组卡!'];
+                  $newReport=new LaborReport([
+                      'user_workgroup_id'=>$userWorkGroup,
+                      'user_id'=>$laborReport->user_id,
+                      'name'=>$laborReport->user->userDetail->full_name??'',
+                      'mobile_phone'=>$laborReport->user->userDetail->mobile_phone??'',
+                      'identity_number'=>$laborReport->user->userDetail->identity_number??'',
+                      'labor_company_id'=>$laborReport->labor_company_id,
+                      'check_in_at'=>$checked_at,
+                      'group_user_id'=>Auth::user()['id'],
+                      'user_duty_check_id'=>$laborReport->user_duty_check_id,
+                  ]);
+                  $newReport['enter_number']=$laborReport->enter_number??'';
+                  $newReport->save();
+                  $laborReportStatus=new LaborReportStatus([
+                      'labor_report_id'=>$newReport['id'],
+                      'status'=>'已换组',
+                  ]);
+                  $laborReportStatus->save();
+                  $newReport=$newReport->loadMissing('userDutyCheck');
+                  if ($remark)$laborReportService->addOrUpdateRemark($remark,$newReport->id);
+                  app('LogService')->log(__METHOD__,"录入进组补卡".__FUNCTION__,json_encode($newReport),Auth::user()['id']);
+                  return ['success'=>true,'data'=>$newReport->userDutyCheck];
+              }
+            case '退组':
+                $laborReport=LaborReport::query()->with('userDutyCheck')
+                    ->where('user_id',$user_id)
+                    ->where('created_at','like',$checkedAtDate.'%')
+                    ->orderBy('id','desc')->first();
+                if ($laborReport && !$laborReport->check_out_at){
+                    $laborReport->update([
+                        'check_out_at'=>$checked_at,
+                    ]);
+                    LaborReportStatus::query()->create([
+                        'labor_report_id'=>$laborReport['id'],
+                        'status'=>'已退组',
+                        'created_at'=>$checked_at,
+                    ]);
+                    if ($remark)$laborReportService->addOrUpdateRemark($remark,$laborReport->id);
+                    app('LogService')->log(__METHOD__,"录入退组补卡".__FUNCTION__,json_encode($laborReport),Auth::user()['id']);
+                    return ['success'=>true,'data'=>$laborReport->userDutyCheck];
+                }else  return ['result'=>true,'data'=>'已存在退组记录!'];
+            default:
+                $userDutyCheck=new UserDutyCheck([
+                    'user_id'=>$user_id,
+                    'checked_at'=>$checked_at,
+                    'type'=>$type,
+                    'source'=>'补入',
+                    'verify_user_id'=>Auth::user()['id'],
+                ]);
+                $userDutyCheckBefore=UserDutyCheck::query()->where('user_id',$user_id)->where('checked_at','like',$checkedAtDate.'%')->orderBy('id','desc')->first();
+                if ($userDutyCheckBefore['type']=='登入'&&$userDutyCheck->type=='登入')return ['result'=>true,'data'=>'已存在进场记录!'];
+                if ($userDutyCheckBefore['type']=='登出'&&$userDutyCheck->type=='登出')return ['result'=>true,'data'=>'已存在出场记录!'];
+                $userDutyCheck->save();
+                app('LogService')->log(__METHOD__,"录入补卡".__FUNCTION__,json_encode($userDutyCheck),Auth::user()['id']);
+                $errorMessage=$this->makeOrUpdateLaborReport($userDutyCheck,$remark);
+                if ($errorMessage)return $errorMessage;
+                return ['success'=>true,'data'=>$userDutyCheck];
+        }
     }
     //补卡创建或修改临时工报表
     public function makeOrUpdateLaborReport($userDutyCheck,$remark){
         $checkedAtDate=Carbon::parse($userDutyCheck->checked_at)->format('Y-m-d');
-        $laborReport=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$checkedAtDate.'%')->orderBy('id','desc')->first();
+        $laborReport=LaborReport::query()->where('user_id',$userDutyCheck->user_id)->where('created_at','like',$checkedAtDate.'%')->orderBy('id','desc')->first();
         /** @var LaborReportService $laborReportService */
         $laborReportService=app(LaborReportService::class);
         if (!$laborReport&&$userDutyCheck->type=='登入'){
@@ -66,9 +142,9 @@ class PersonnelController extends Controller
         else if(!$laborReport&&$userDutyCheck->type=='登出'){
             //退场时间跨天情况
             $yesterdayDate=Carbon::parse($userDutyCheck->checked_at.':00')->subDays(1)->format('Y-m-d');
-            $laborReportYesterday=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$yesterdayDate.'%')->orderBy('id','desc')->first();
+            $laborReportYesterday=LaborReport::query()->where('user_id',$userDutyCheck->user_id)->where('created_at','like',$yesterdayDate.'%')->orderBy('id','desc')->first();
             if ($laborReportYesterday&&!$laborReportYesterday['check_out_at']){
-                UserDutyCheck::where('user_id',$laborReportYesterday['user_id'])->where('type','登出')->orderBy('id','desc')->delete();
+                UserDutyCheck::query()->where('user_id',$laborReportYesterday['user_id'])->where('type','登出')->orderBy('id','desc')->delete();
                 return ['result'=>true,'data'=>'该临时工还未退组,暂不可补退场卡!'];
             }
             if ($laborReportYesterday){
@@ -80,7 +156,7 @@ class PersonnelController extends Controller
             }
         }else if($laborReport){
             if (!$laborReport->check_out_at){
-                UserDutyCheck::where('user_id',$laborReport->user_id)->where('type','登出')->orderBy('id','desc')->delete();
+                UserDutyCheck::query()->where('user_id',$laborReport->user_id)->where('type','登出')->orderBy('id','desc')->delete();
                 return ['result'=>true,'data'=>'该临时工还未退组,暂不可补退场卡!'];
             }
             $exportReport=$laborReportService->exportReplenishToCreateLaborReportData($laborReport,$userDutyCheck);
@@ -91,22 +167,21 @@ class PersonnelController extends Controller
         }
     }
 
+    //搜索临时工下打卡信息
+    public function checkUserLabors(Request $request){
+        if(!Gate::allows('人事管理-录入补卡')){ return redirect(url('/'));  }
+        $full_name=$request->input('full_name');
+        $userDetail=UserDetail::with(['userDutyChecks'=>function ($query){
+            return $query->orderBy('checked_at','DESC')->limit(5);
+        }])->where('full_name',$full_name)->get();
+        return ['success'=>true,'data'=>$userDetail];
+    }
 
-
-
-
-
-    //任务审核
-    public function storeMissionAudit(Request $request){
-        if(!Gate::allows('人事管理-任务审核')){ return redirect(url('/'));  }
-        $id=$request->input('id');
-        if (!$id)return ['error'=>'提交审核失败!'];
-        $processDailyParticipant=ProcessDailyParticipant::find($id);
-        if (!$id)return ['error'=>'未找到对应记录!'];
-        $processDailyParticipant->status='已审核';
-        $processDailyParticipant->update();
-        app('LogService')->log(__METHOD__,"任务审核".__FUNCTION__,json_encode($processDailyParticipant),Auth::user()['id']);
-        return;
+    //考勤
+    public function createReplenishClock(){
+        if(!Gate::allows('人事管理-录入补卡')){ return view('personnel/checkRelating/index');  }
+        $userWorkGroups=UserWorkgroup::query()->get();
+        return view('personnel/checking-in/createReplenishClock',compact('userWorkGroups'));
     }
 
     //打卡审核时判断是否异常
@@ -179,7 +254,7 @@ class PersonnelController extends Controller
                     $laborReportLast->delete();
                 }
             }
-        }else if ($laborReport){
+        }else{
             LaborReport::updateLaborReportVerify($laborReport,$userDutyCheck);
             app('LogService')->log(__METHOD__,"打卡组长审核".__FUNCTION__,json_encode($userDutyCheck),Auth::user()['id']);
         }
@@ -252,22 +327,6 @@ class PersonnelController extends Controller
         return view('personnel/checking-in/clockAudit',['userDutyChecks'=>$userDutyChecks,'laravelEchoPrefix'=>$laravelEchoPrefix,'permittingWorkgroups'=>$permittingWorkgroups]);
     }
 
-    //搜索临时工下打卡信息
-    public function checkUserLabors(Request $request){
-        if(!Gate::allows('人事管理-录入补卡')){ return redirect(url('/'));  }
-        $full_name=$request->input('full_name');
-        $userDetail=UserDetail::with(['userDutyChecks'=>function ($query){
-            return $query->orderBy('checked_at','DESC')->limit(5);
-        }])->where('full_name',$full_name)->get();
-        return ['success'=>true,'data'=>$userDetail];
-    }
-
-    //考勤
-    public function createReplenishClock(){
-        if(!Gate::allows('人事管理-录入补卡')){ return view('personnel/checkRelating/index');  }
-        return view('personnel/checking-in/createReplenishClock');
-    }
-
     public function validatorUserDutyCheck(Request $request){
         $validator=Validator::make($request->input(),[
             'user_id'=>'required',
@@ -298,4 +357,17 @@ class PersonnelController extends Controller
         app('LogService')->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
         return ['success'=>true,'data'=>$userDutyCheck];
     }
+
+    //任务审核
+    public function storeMissionAudit(Request $request){
+        if(!Gate::allows('人事管理-任务审核')){ return redirect(url('/'));  }
+        $id=$request->input('id');
+        if (!$id)return ['error'=>'提交审核失败!'];
+        $processDailyParticipant=ProcessDailyParticipant::find($id);
+        if (!$id)return ['error'=>'未找到对应记录!'];
+        $processDailyParticipant->status='已审核';
+        $processDailyParticipant->update();
+        app('LogService')->log(__METHOD__,"任务审核".__FUNCTION__,json_encode($processDailyParticipant),Auth::user()['id']);
+        return;
+    }
 }

+ 1 - 5
app/Http/Controllers/PriceModelController.php

@@ -1164,8 +1164,6 @@ class PriceModelController extends Controller
             "strategy"          => request("strategy"),
             "feature"           => request("feature"),
             "type_mark"         => request()->has("type_mark") ? \request("type_mark") : null,
-            "surcharge"         => request("surcharge") ? request("surcharge") : null,
-            "surcharge_unit_id" => request("surcharge_unit_id") ? request("surcharge_unit_id") : null,
             "remark"            => request("remark"),
             "discount_count"    => implode(",",request("discount_count")),
             "total_price"       => request("total_price"),
@@ -1176,7 +1174,7 @@ class PriceModelController extends Controller
             if ($model->operation){
                 app('OwnerPriceOperationService')->findUpdate($model,$operation);
                 $delete = [];//需要删除子项
-                $update = [["id","strategy","amount","unit_id","unit_price","feature","discount_price","odd_price"]];//需要更新子项
+                $update = [["id","strategy","amount","unit_id","unit_price","feature","discount_price"]];//需要更新子项
                 $insert = [];//需要新增子项
                 foreach ($params["items"] as $item){
                     $obj = [
@@ -1185,7 +1183,6 @@ class PriceModelController extends Controller
                         "unit_id"   => $item["unit_id"],
                         "unit_price"=> $item["unit_price"],
                         "feature"   => $item["feature"] ?? null,
-                        "odd_price" => $item["odd_price"] ?? null,
                         "discount_price"   => implode(",",$item["discount_price"] ?? []),
                     ];
                     if (isset($item["id"])){
@@ -1212,7 +1209,6 @@ class PriceModelController extends Controller
                     $temp["discount_price"]  = implode(",",$item["discount_price"] ?? []);
                     $temp["owner_price_operation_id"] = $model->id;
                     $temp["feature"] = $item["feature"] ?? null;
-                    $temp["odd_price"] = $item["odd_price"] ?? null;
                     $temp["strategy"] = $item["strategy"];
                     $temp["amount"] = $item["amount"];
                     $temp["unit_id"] = $item["unit_id"];

+ 12 - 8
app/Http/Controllers/ProcurementController.php

@@ -66,11 +66,16 @@ class ProcurementController extends Controller
         $owner_ids=app('UserService')->getPermittingOwnerIds(auth()->user());
         $procurements = Procurement::query()
             ->filter($filters)
-            ->with(['initiator','ownerMaterial.file','ownerMaterial.material','ownerMaterial.owner'=>function($query)use($owner_ids){
+            ->with(['initiator','ownerMaterial.file','ownerMaterial.material','supplier','ownerMaterial.owner'=>function($query)use($owner_ids){
                 $query->with('customer')->whereIn('id',$owner_ids);
             },'procurementDeliveries'])->paginate($param['paginate'] ?? 50);
         foreach ($procurements as $procurement){
             if (empty($procurement->procurementDeliveries))continue;
+            if (Carbon::now()->gt($procurement['deadline'])){
+                $procurement->isFinishEnquiry=true;
+            }else{
+                $procurement->isFinishEnquiry=false;
+            }
             $procurement->deliver_amount=$procurement->procurementDeliveries->sum('amount');
         }
         /** @var OwnerMaterialService $ownerMaterialService*/
@@ -107,7 +112,7 @@ class ProcurementController extends Controller
         $request->validated();
         $param=$request->all(['owner_material_id','quantity','amount','unit_price']);
         $procurement=$this->newProcurement($param,Auth::user()['id']);
-        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file']);
+        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file','supplier']);
         if ($procurement) return ['success' => true,'data' => $procurement];
         else return ['success' => false, 'message' => '添加失败'];
 
@@ -126,7 +131,6 @@ class ProcurementController extends Controller
             'initiator'=>Auth::user()['id'],
             'type'=>1,
             'status'=>0,
-            'time'=>14400000,
         ]);
         $procurement->save();
         $number_id=$procurement['id'];
@@ -137,7 +141,7 @@ class ProcurementController extends Controller
         $deadline=$procurementService->computeDeadline($procurement->created_at);
         $procurement->update(['code'=>$procurement_code,'deadline'=>$deadline]);
         dispatch(new ProcurementConfirmInform($procurement));  //推送发送订单通知消息模板  队列
-        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file']);
+        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file','supplier']);
         if ($procurement) return ['success' => true,'data' => $procurement];
         else return ['success' => false, 'message' => '添加失败'];
 
@@ -166,7 +170,7 @@ class ProcurementController extends Controller
         $deadline=$procurementService->computeDeadline($procurement->created_at);
         $procurement->update(['code'=>$procurement_code,'deadline'=>$deadline]);
         dispatch(new ProcurementConfirmInform($procurement));  //推送发送订单通知消息模板  队列
-        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file']);
+        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file','supplier']);
         if ($procurement) return ['success' => true,'data' => $procurement];
         else return ['success' => false, 'message' => '添加失败'];
 
@@ -208,7 +212,7 @@ class ProcurementController extends Controller
         ]);
         dispatch(new ProcurementReceive($procurement))->delay(now()->addHours($receive_time)); //可从系统配置获取
         dispatch(new ProcurementWaitConfirmInform($procurement));
-        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file']);
+        $procurement = $procurement->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file','supplier']);
         if ($procurement) return ['success' => true,'data' => $procurement];
         else return ['success' => false, 'message' => '发起采购失败'];
     }
@@ -230,7 +234,7 @@ class ProcurementController extends Controller
         $cost_price=$request->input('cost_price');
         $procurement=Procurement::query()->find($id);
         if ($procurement->cost_price!=$cost_price)$procurement->update(['cost_price'=>$cost_price]);
-        $procurement = $procurement->loadMissing(['initiator','supplier','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file']);
+        $procurement = $procurement->loadMissing(['initiator','supplier','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file','supplier']);
         if ($procurement) return ['success' => true,'data' => $procurement];
         else return ['success' => false, 'message' => '修改采购单价失败!'];
 
@@ -248,7 +252,7 @@ class ProcurementController extends Controller
             }else{
                 $pro=$this->newProcurement($procurement,Auth::user()['id'],$procurement->type);
             }
-            $pro->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file']);
+            $pro->loadMissing(['initiator','ownerMaterial.material','ownerMaterial.owner.customer','ownerMaterial.file','supplier']);
             $collect->add($pro);
         }
         if (!empty($collect)) return ['success' => true,'data' => $collect];

+ 10 - 1
app/Http/Controllers/TestController.php

@@ -279,13 +279,22 @@ class TestController extends Controller
     {
         app('ForeignHaiRoboticsService')->markBinProcessed(
             '1',
-            'IDE0005680',
+            'IDE0005714',
             true,
             "2021-56-24 05-03-15",
             '',
             true
         );
     }
+    function hHasTaken(Request $request)
+    {
+        app('ForeignHaiRoboticsService')->taskUpdate(
+            301
+            ,1
+            ,0
+            ,'IDE0005714'
+        );
+    }
     function hBatch(Request $request)
     {
         $a=[

+ 17 - 20
app/Http/Controllers/UserDutyCheckController.php

@@ -52,10 +52,8 @@ class UserDutyCheckController extends Controller
             if($userDetail){
                 if($importAndExportQRCodeType=='import') return redirect('personnel/checking-in/userDutyCheck/updateUserLaborCompanies/' . $userDetail->mobile_phone)->with("importAndExportQRCodeType", $importAndExportQRCodeType);
                 $userDutyCheck = $this->importAndExportDutyCheck($user_id, $importAndExportQRCodeType);
-                if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
-                if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
-                if ($userDutyCheck && $userDutyCheck->export == true) return "<h1 style='color: darkred;text-align:center'>您已出场,不可再次出场!!</h1>";
-                if ($userDutyCheck&& !$userDutyCheck->id) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+                $error=$this->hasError($userDutyCheck);
+                if ($error) return $error;
                 $laborReportService = app('LaborReportService');
                 $errorMessage = $laborReportService->makeOrChangeLaborReportByUserDutyCheck($userDutyCheck, $importAndExportQRCodeType);
                 if ($errorMessage) return $errorMessage;
@@ -83,17 +81,13 @@ class UserDutyCheckController extends Controller
         if (Cache::has('dutyCheckTokenUser_'.$userDetail->user_id)) return "<h1 style='color: red;text-align:center'>请使用原有设备进行打卡,如无法使用原有设备请联系管理人员解绑设备!</h1>";
         if($importAndExportQRCodeType=='import') return redirect('personnel/checking-in/userDutyCheck/updateUserLaborCompanies/' . $userDetail->mobile_phone)->with("importAndExportQRCodeType", $importAndExportQRCodeType);
         $userDutyCheck=$this->importAndExportDutyCheck($userDetail->user_id, $importAndExportQRCodeType);
-        if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
-        if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
-        if ($userDutyCheck && $userDutyCheck->export == true) return "<h1 style='color: darkred;text-align:center'>您已出场,不可再次出场!!</h1>";
-        if ($userDutyCheck&& !$userDutyCheck->id) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
-        //$userLaborToken = $userDetail->getDutyCheckToken(config('users.token_check_in_expire_minutes'));
+        $error=$this->hasError($userDutyCheck);
+        if ($error) return $error;
         $laborReportService = app('LaborReportService');
         $errorMessage = $laborReportService->makeOrChangeLaborReportByUserDutyCheck($userDutyCheck, $importAndExportQRCodeType);
         if ($errorMessage) return $errorMessage;
         $laravelEchoPrefix = config('database.redis.options.prefix');
         return response()->view('personnel/checking-in/importAndExportSuccess', ['full_name' => $userDetail->full_name, 'checked_at' => $userDutyCheck->checked_at, 'type' => $userDutyCheck->type, 'laravelEchoPrefix' => $laravelEchoPrefix]);
-//        ->cookie('userLaborToken', $userLaborToken, config('users.token_check_in_expire_minutes'), '/')
     }
 
     //根据用户提交进出场打卡记录
@@ -186,10 +180,8 @@ class UserDutyCheckController extends Controller
         ]);
         app('LogService')->log(__METHOD__, "更改临时工劳务所信息" . __FUNCTION__, json_encode($userLabor), Auth::user()['id']);
         $userDutyCheck=$this->importAndExportDutyCheck($userDetail->user_id,$importAndExportQRCodeType);
-        if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
-        if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
-        if ($userDutyCheck && $userDutyCheck->export == true) return "<h1 style='color: darkred;text-align:center'>您已出场,不可再次出场!!</h1>";
-        if ($userDutyCheck&& !$userDutyCheck->id) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+        $error=$this->hasError($userDutyCheck);
+        if ($error) return $error;
         $userLaborToken = $userDetail->getDutyCheckToken(config('users.token_check_in_expire_minutes'));
         $laborReportService = app('LaborReportService');
         $errorMessage = $laborReportService->makeOrChangeLaborReportByUserDutyCheck($userDutyCheck, $importAndExportQRCodeType);
@@ -247,10 +239,8 @@ class UserDutyCheckController extends Controller
         $userLabor->save();
         $laborReportService = app('LaborReportService');
         $userDutyCheck=$this->importAndExportDutyCheck($userDetail->user_id,$importAndExportQRCodeType);
-        if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
-        if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
-        if ($userDutyCheck && $userDutyCheck->export == true) return "<h1 style='color: darkred;text-align:center'>您已出场,不可再次出场!!</h1>";
-        if ($userDutyCheck&& !$userDutyCheck->id) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+        $error=$this->hasError($userDutyCheck);
+        if ($error) return $error;
         $laborReportService->makeLaborReportByUserDutyCheck($userDutyCheck);
         $userLaborToken=$userDetail->getDutyCheckToken(config('users.token_check_in_expire_minutes'));
         Controller::logS(__METHOD__,"录入临时工,用户,对应工作组,打卡记录".__FUNCTION__,json_encode($userDetail));
@@ -333,7 +323,7 @@ class UserDutyCheckController extends Controller
             $newLaborReport = $laborReportService->enterGroupAndUpdateLaborReport($laborReport, $userWorkgroupID);
             app('LogService')->log(__METHOD__, "当日首次进组更新临时工报表记录__" . __FUNCTION__, json_encode($userWorkgroupID));
             if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
-            if ($newLaborReport) event(new ClockinEvent($newLaborReport));
+            event(new ClockinEvent($newLaborReport));
         } else {
             //换组判断上一条临时工报表信息是否退组
             $laborReportNow = LaborReport::where('user_id', $user_id)->orderBy('id', 'desc')->first();
@@ -343,7 +333,7 @@ class UserDutyCheckController extends Controller
             $newLaborReport = $laborReportService->changeGroupAndMakeLaborReport($user_id, $userWorkgroupID);
             app('LogService')->log(__METHOD__, "当日临时工换组新建临时工报表记录__" . __FUNCTION__, json_encode([$user_id, $userWorkgroupID]));
             if (!$newLaborReport) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
-            if ($newLaborReport) event(new ClockinEvent($newLaborReport));
+            event(new ClockinEvent($newLaborReport));
         }
         if ($userLaborToken){
             return response()->view('personnel/checking-in/success', ['group_name' => $group_name ?? '', 'full_name' => $userDetail->full_name, 'check_in_at' => $newLaborReport->check_in_at, 'laravelEchoPrefix' => $laravelEchoPrefix])
@@ -365,5 +355,12 @@ class UserDutyCheckController extends Controller
         $html=$this->updateLaborReport($userDetail->user_id,$userWorkgroupID,$userLaborToken);
         if ($html)return $html;
     }
+    private function hasError($userDutyCheck)
+    {
+        if ($userDutyCheck && $userDutyCheck->isNotImport == true) return "<h1 style='color: darkred;text-align:center'>当前还未入场,不可出场!</h1>";
+        if ($userDutyCheck && $userDutyCheck->import == true) return "<h1 style='color: darkred;text-align:center'>您已入场,不可再次入场!</h1>";
+        if ($userDutyCheck && $userDutyCheck->export == true) return "<h1 style='color: darkred;text-align:center'>您已出场,不可再次出场!!</h1>";
+        if ($userDutyCheck&& !$userDutyCheck->id) return "<h1 style='color: red;text-align:center'>打卡异常,请联系相关人员!</h1>";
+    }
 
 }

+ 3 - 2
app/Http/Controllers/WaybillPriceModelController.php

@@ -6,6 +6,7 @@ use App\Region;
 use App\WaybillPriceModel;
 use App\Events\WaybillPriceModelEvent;
 use App\Imports\WaybillPriceModelsImport;
+use App\Province;
 use App\Unit;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
@@ -20,7 +21,7 @@ class WaybillPriceModelController extends Controller
     {
         if(!Gate::allows('计费模型-查询')){ return redirect(url('/'));  }
         $logistics=app('LogisticService')->getSelection(["id","name"],"物流");
-        $provinces=Region::query()->where("type",1)->get();
+        $provinces=Province::query()->get();
         $data=$request->input();
         $waybillPriceModels= WaybillPriceModel::query()->with(["logistic","province","city","unit"])->orderBy('id', 'DESC');
         if ($data){
@@ -158,7 +159,7 @@ class WaybillPriceModelController extends Controller
             'WaybillPriceModel.province_id'=>'required|integer',
             'WaybillPriceModel.logistic_id'=>'required|integer',
             'WaybillPriceModel.unit_id'=>'required|integer',
-            'WaybillPriceModel.city_id'=>'nullable|integer',
+            'WaybillPriceModel.city_id'=>'nullable|Integer',
             'WaybillPriceModel.range_min'=> 'nullable|min:0|numeric|max:999999',
             'WaybillPriceModel.range_max'=> "nullable|min:{$min}|numeric|max:999999",
             'WaybillPriceModel.unit_price'=>'required|min:0|numeric|max:999999',

+ 0 - 1
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -82,7 +82,6 @@ class WaybillController extends Controller
                 'recipient'=>$receiveInputting['ConsigneeName']??'',
                 'recipient_mobile'=>$recipient_mobile??'',
                 'source_bill'=>$receiveInputting['ReservedField01']??'',
-                'is_to_pay'=>strstr($receiveInputting['CarrierID']??'','DF')===false ? 0 : 1,
                 'destination_city_id'=>app(RegionService::class)->getCity($receiveInputting['C_City']),
             ]);
             $dflist=config('merchantsInfo.waybill.DFList');

+ 12 - 7
app/Http/Controllers/api/thirdPart/weixin/ProcurementController.php

@@ -14,6 +14,7 @@ use App\Services\ProcurementService;
 use Carbon\Carbon;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\DB;
 
 class ProcurementController extends Controller
 {
@@ -28,15 +29,11 @@ class ProcurementController extends Controller
             ->where('status',$status)
             ->get();
         $keys = [];
-        $now=Carbon::now();
         foreach ($procurements as $key=>$procurement){
             if ($procurement->procurement_quotations_count>0 && $status==0 )$keys[]= $key;
             if ($procurement->type==2 && $procurement->supplier_id )$keys[]= $key;
-            if($status==0){
-                if ($procurement->deadline>$now) $procurement->deadline=Carbon::parse($procurement->deadline)->diffInMilliseconds(); //待报价倒计时4小时
-                else $procurement->deadline=0;
-            }
-            if($status==2)$procurement->deadline=Carbon::parse($procurement->deadline)->subHours(-24)->diffInMilliseconds(Carbon::now()); //待接单倒计时24小时
+            if (Carbon::parse($procurement->deadline)->gt(Carbon::now())) $procurement->deadline=Carbon::parse($procurement->deadline)->diffInMilliseconds();
+            else $procurement->deadline=0;
         }
         $procurements = $procurements->diffKeys($keys);
         if (!empty($procurements)) return $this->success($procurements);
@@ -69,7 +66,15 @@ class ProcurementController extends Controller
             'quoted_at'=>Carbon::now()->toDateTimeString(),
             'status'=>1,//2:已报价
         ]);
-        $procurement->update(['status'=>1]);//1:已报价
+        DB::transaction(function ()use($procurement,$param,$supplier){
+            if (!$procurement->supplier_id)$procurement->update([
+                "supplier_id" => $supplier->id,
+                "status" =>1,
+                "cost_price" =>$param['offer'],
+            ]);
+            DB::commit();
+        });
+//        $procurement->update(['status'=>1]);//1:已报价
         if ($procurementQuotation) return $this->success($procurementQuotation);
     }
     //接单

+ 1 - 2
app/Imports/ExpressImport.php

@@ -100,12 +100,11 @@ class ExpressImport implements WithMultipleSheets,ToArray
             }else $item[0] = $map[$province];
             $sign = false;
             for($i=1;$i<count($item);$i++){
-                if (($item[$i] && !is_numeric($item[$i])) || ($item[$i]!==null && $item[$i]<=0)){
+                if (($item[$i] && !is_numeric($item[$i]))||$item[$i]<=0){
                     $this->errors[] = "“".$province."”非法价格";
                     $sign = true;
                     break;
                 }
-                if ($item[$i]===null && $i>3)break;
             }
             if ($sign)continue;
             $result[] = $item;

+ 0 - 1
app/Jobs/ProcurementEnquiry.php

@@ -60,7 +60,6 @@ class ProcurementEnquiry implements ShouldQueue
            ]);
             dispatch(new ProcurementReceive($this->procurement))->delay(now()->addHours($receive_time)); //可从系统配置获取
             dispatch(new ProcurementWaitConfirmInform($this->procurement));
-
         }catch (\Exception $e){
             LogService::log(__METHOD__,"ERROR-采购延时选定最低报价供应商",$this->procurement->toJson()." | ".$e->getMessage());
         }

+ 13 - 7
app/LaborReport.php

@@ -38,22 +38,28 @@ class LaborReport extends Model
     static function tokenOfBroadcastEnterAndLeave(){
         return md5('tokenOfListAll'.Carbon::now()->format('Y-m-d'));
     }
-    public function userWorkgroup(){
+    public function userWorkgroup(): \Illuminate\Database\Eloquent\Relations\HasOne
+    {
         return $this->hasOne('App\UserWorkgroup','id','user_workgroup_id');
     }
-    public  function laborCompany(){
+    public  function laborCompany(): \Illuminate\Database\Eloquent\Relations\HasOne
+    {
         return $this->hasOne('App\LaborCompany','id','labor_company_id');
     }
-    public function user(){
+    public function user(): \Illuminate\Database\Eloquent\Relations\HasOne
+    {
         return $this->hasOne('App\User','id','group_user_id');
     }
-    public function userDutyCheck(){
+    public function userDutyCheck(): \Illuminate\Database\Eloquent\Relations\HasOne
+    {
         return $this->hasOne('App\UserDutyCheck','id','user_duty_check_id');
     }
-    public function laborReportStatus(){
+    public function laborReportStatus(): \Illuminate\Database\Eloquent\Relations\HasMany
+    {
         return $this->hasMany('App\LaborReportStatus','labor_report_id','id');
     }
-    public function laborReports(){
+    public function laborReports(): \Illuminate\Database\Eloquent\Relations\HasMany
+    {
         return $this->hasMany(get_class($this),'enter_number','enter_number');
     }
 
@@ -271,7 +277,7 @@ class LaborReport extends Model
     }
 
     //创建或获取进场编号
-    public function makeOrGetEnteringNumber()
+    public function makeOrGetEnteringNumber(): string
     {
         if($this['enteringRecord']&&$this['enteringRecord']['enter_number'])
             return $this['enteringRecord']['enter_number'];

+ 0 - 2
app/OwnerPriceOperation.php

@@ -23,8 +23,6 @@ class OwnerPriceOperation extends Model
         "operation",        //操作
         "target_id",        //目标ID
         "type_mark",        //类型标记
-        "surcharge",        //附加费
-        "surcharge_unit_id",//附加费单位
     ];
     public static $features = null;
     public static $columnMapping = null;

+ 0 - 1
app/OwnerPriceOperationItem.php

@@ -19,7 +19,6 @@ class OwnerPriceOperationItem extends Model
         "feature",                          //特征
         "priority",                         //优先级 值越大越高
         "discount_price",                   //减免单价
-        "odd_price",                        //零头价
     ];
     public $timestamps=false;
 

+ 2 - 0
app/Procurement.php

@@ -4,6 +4,7 @@ namespace App;
 
 use App\Services\api\UserService;
 use App\Traits\ModelTimeFormat;
+use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Model;
 
@@ -55,6 +56,7 @@ class Procurement extends Model
         }
     }
 
+
     public  function ownerMaterial(): \Illuminate\Database\Eloquent\Relations\HasOne
     {
         return $this->hasOne('App\OwnerMaterial','id','owner_material_id');

+ 4 - 2
app/ProcurementQuotation.php

@@ -31,10 +31,12 @@ class ProcurementQuotation extends Model
         8 => "已出账",
         9 => "完结",
     ];
-    public  function supplier(){
+    public  function supplier(): \Illuminate\Database\Eloquent\Relations\HasOne
+    {
         return $this->hasOne('App\Supplier','id','supplier_id');
     }
-    public function procurement(){
+    public function procurement(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
         return $this->belongsTo('App\Procurement','procurement_id','id');
     }
 

+ 4 - 2
app/Providers/AppServiceProvider.php

@@ -97,6 +97,7 @@ use App\Services\WeighExceptedService;
 use App\Services\OrderFreezeService;
 use App\Services\RegionService;
 use App\Services\UserWorkgroupService;
+use App\Services\DeliveryAppointment;
 use App\Services\DischargeTaskService;
 use App\Services\DeliveryAppointmentService;
 use Illuminate\Queue\Events\JobFailed;
@@ -104,7 +105,6 @@ use Illuminate\Support\Facades\Queue;
 use Illuminate\Support\Facades\Schema;
 use Illuminate\Support\Facades\View;
 use Illuminate\Support\ServiceProvider;
-
 use Ramsey\Uuid\Uuid;
 use Illuminate\Support\Facades\Validator;
 
@@ -212,16 +212,17 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('OwnerReportService',OwnerReportService::class);
         app()->singleton('OwnerService',OwnerService::class);
         app()->singleton('OwnerStoragePriceModelService',OwnerStoragePriceModelService::class);
+        app()->singleton('OwnerMaterialService',OwnerMaterialService::class);
         app()->singleton('PackageService',PackageService::class);
         app()->singleton('PackageStatisticsService',PackageStatisticsService::class);
         app()->singleton('ProcessMethodService',ProcessMethodService::class);
         app()->singleton('ProcessService',ProcessService::class);
         app()->singleton('ProcessStatisticService',ProcessStatisticService::class);
         app()->singleton('ProcessesContentService',ProcessesContentService::class);
+        app()->singleton('ProvinceService',ProvinceService::class);
         app()->singleton('ProcurementService',ProcurementService::class);
         app()->singleton('ProcurementTotalBillService',ProcurementTotalBillService::class);
         app()->singleton('ProcurementWeiXinSendMessageService',ProcurementWeiXinSendMessageService::class);
-        app()->singleton('ProvinceService',ProvinceService::class);
         app()->singleton('RealtimePendingOrdersService',RealtimePendingOrdersService::class);
         app()->singleton('RegionService',RegionService::class);
         app()->singleton('RejectedBillItemService',RejectedBillItemService::class);
@@ -246,6 +247,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('UnitService',UnitService::class);
         app()->singleton('UserOwnerGroupService',UserOwnerGroupService::class);
         app()->singleton('UserService',UserService::class);
+        app()->singleton('ApiUserService',\App\Services\api\UserService::class);
         app()->singleton('UserWorkgroupService',UserWorkgroupService::class);
         app()->singleton('WarehouseService',WarehouseService::class);
         app()->singleton('WaybillFinancialService',WaybillFinancialService::class);

+ 0 - 1
app/Services/CommodityBarcodeService.php

@@ -147,7 +147,6 @@ class CommodityBarcodeService
         $commodities = Commodity::query()
             ->whereIn('owner_id', array_unique($owner_id))
             ->whereIn('sku', array_unique($sku))
-            ->groupBy('owner_id', 'sku')
             ->get();
         $commodities_map = $dataHandlerService->dataHeader(['owner_id','sku'], $commodities);
         $params = [];

+ 4 - 5
app/Services/CommodityService.php

@@ -189,7 +189,6 @@ class CommodityService
         $commodities = Commodity::query()
             ->whereIn('owner_id', data_get($owners, '*.id'))
             ->whereIn('sku', $orderHeader_sku)
-            ->groupBy('owner_id', 'sku')  //*!!!!!!!!
             ->get();
 
         if ($commodities->count() < count($customerId_sku_map)) {
@@ -515,7 +514,6 @@ class CommodityService
         $commodities = Commodity::query()
             ->whereIn('owner_id', array_unique($owner_id))
             ->whereIn('sku', array_unique($sku))
-            ->groupBy('owner_id', 'sku')
             ->get();
         $unexists = [];
         foreach ($owner_sku_map as $item) {
@@ -541,7 +539,8 @@ class CommodityService
         $inner_params = (function () use ($BasSKUs, $owner_map) {
             $map = [];
             $BasSKUs->each(function ($basSku) use (&$map, $owner_map) {
-                $map[] = [
+                $key = $basSku['sku'].$owner_map[$basSku['customerid']];
+                $map[$key] = [
                     'owner_id' => $owner_map[$basSku['customerid']] ?? '',
                     'sku' => $basSku->sku,
                     'name' => $basSku->descr_c,
@@ -596,7 +595,6 @@ class CommodityService
         $commodities = Commodity::query()
             ->whereIn('owner_id', array_unique($owner_id))
             ->whereIn('sku', array_unique($sku))
-            ->groupBy('owner_id', 'sku')
             ->get();
         $commodities_map = $dataHandlerService->dataHeader(['owner_id', 'sku'], $commodities);
         $updateParams = [[
@@ -609,7 +607,8 @@ class CommodityService
             if (!$commodity) $commodity = $dataHandlerService->getKeyValue(['owner_id' => $owner_map[$basSku['customerid']], 'sku' => $basSku['sku']], $commodities_map);
                 if (!$commodity) {
                     $updateBasSkus->add($basSku);
-                    $insert_params[] = [
+                    $key = $basSku['sku'].$owner_map[$basSku['customerid']];
+                    $insert_params[$key] = [
                         'owner_id' => $owner_map[$basSku['customerid']] ?? '',
                         'sku' => $basSku->sku,
                         'name' => $basSku->descr_c,

+ 7 - 6
app/Services/ForeignHaiRoboticsService.php

@@ -17,10 +17,10 @@ class ForeignHaiRoboticsService
     use ServiceAppAop;
 //    protected $modelClass=ForeignHaiRobotics::class;
 
-    /** @var  $stationTaskBatchService StationTaskBatchService */
-    private $stationTaskBatchService;
     /** @var  $stationTaskMaterialBoxService StationTaskMaterialBoxService */
     private $stationTaskMaterialBoxService;
+    /** @var  $stationTaskBatchService StationTaskBatchService */
+    private $stationTaskBatchService;
     /** @var  $stationTaskCommoditiesService StationTaskCommodityService */
     private $stationTaskCommoditiesService;
     /** @var  $materialBoxService MaterialBoxService */
@@ -118,6 +118,7 @@ class ForeignHaiRoboticsService
         $this->instant($this->materialBoxService,'MaterialBoxService');
         $this->instant($this->stationTaskMaterialBoxService,'StationTaskMaterialBoxService');
         $this->instant($this->stationTaskCommoditiesService,'StationTaskCommodityService');
+        $this->instant($this->stationTaskBatchService,'StationTaskBatchService');
         try{
             LogService::log('海柔请求','markBinProcessed1.2',
                 json_encode([$binCode,$success,$exception,$is_in_plan]));
@@ -153,9 +154,9 @@ class ForeignHaiRoboticsService
             if(!$stationTaskMaterialBox){
                 throw new ErrorException('该料箱没有安排在处理队列中');
             }
-            $this->putBinToStore($stationTaskMaterialBox)
-                ?true
-                :(function(){throw new ErrorException('呼叫机器人回收U型线料箱失败');})();
+//            $this->putBinToStore($stationTaskMaterialBox)
+//                ?true
+//                :(function(){throw new ErrorException('呼叫机器人回收U型线料箱失败');})();
             $this->stationTaskMaterialBoxService
                 ->markProcessed($stationTaskMaterialBox);
             LogService::log('海柔请求','markBinProcessed1.7',
@@ -172,9 +173,9 @@ class ForeignHaiRoboticsService
                     ->markProcessing($stationTaskMaterialBox_next['stationTaskCommodities']);//因为上边商品任务被标记完成了,所以这里要将队列中找出正在处理的料箱对应的标记为“处理中”
             if(!$stationTaskMaterialBox_next){
                 $this->instant($this->stationTaskService,'StationTaskService');
-                $stationTaskMaterialBox->loadMissing('stationTaskBatch');
                 LogService::log('海柔请求','markBinProcessed1.81',
                     json_encode($stationTaskMaterialBox['stationTaskBatch']));
+                $stationTaskMaterialBox->loadMissing('stationTaskBatch');
                 $this->stationTaskBatchService->markProcessed($stationTaskMaterialBox['stationTaskBatch']);
                 LogService::log('海柔请求','markBinProcessed1.82',
                     json_encode($stationTaskMaterialBox['stationTaskBatch']));

+ 10 - 26
app/Services/LaborReportService.php

@@ -54,7 +54,7 @@ class LaborReportService
         if((Gate::allows('人事管理-临时工报表-可见全部组')||Gate::allows('人事管理-门卫审核')) && !($params["user_workgroup_id"] ?? false)){
             $laborReports->where(function ($query)use($user){
                 $query->whereIn('labor_reports.user_workgroup_id',$user?$user->getPermittingWorkgroupIds(Gate::allows('人事管理-临时工报表-可见全部组')):[])
-                ->orWhereNull('labor_reports.user_workgroup_id');
+                    ->orWhereNull('labor_reports.user_workgroup_id');
             });
         }else{
             $laborReports->whereIn('labor_reports.user_workgroup_id',
@@ -73,9 +73,9 @@ class LaborReportService
     public function getSql(array $params){
         return $this->conditionQuery($params)->selectRaw("labor_reports.*")
             ->leftJoin('user_workgroups','labor_reports.user_workgroup_id','user_workgroups.id')
-                ->selectRaw('user_workgroups.name user_workgroup_name')
+            ->selectRaw('user_workgroups.name user_workgroup_name')
             ->leftJoin('labor_companies','labor_reports.labor_company_id','labor_companies.id')
-                ->selectRaw('labor_companies.name labor_company')
+            ->selectRaw('labor_companies.name labor_company')
             ->sql();
     }
 
@@ -86,15 +86,13 @@ class LaborReportService
         if (!$laborReport){
             $newReport=$userDutyCheck->makeEnteringRecord();
             Controller::logS(__METHOD__,"进场创建临时工报表记录__".__FUNCTION__,json_encode([$userDutyCheck]));
-            if ($newReport){
-                event(new ImportEvent($newReport));
-            }
+            if ($newReport) event(new ImportEvent($newReport));
         }
     }
     //根据进出场打卡记录 创建或者更新临时工报表记录
     public function makeOrChangeLaborReportByUserDutyCheck($userDutyCheck,$importAndExportQRCodeType){
         $dateNow=Carbon::now()->format('Y-m-d');
-        $laborReport=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$dateNow.'%')->orderBy('id','desc')->first();
+        $laborReport=LaborReport::query()->where('user_id',$userDutyCheck->user_id)->where('created_at','like',$dateNow.'%')->orderBy('id','desc')->first();
         //判断当前日期下临时工是否有临时工报表记录并且是进场打卡
         if ($userDutyCheck->type=='登入'&&$importAndExportQRCodeType=='import'){
             $newReport=$userDutyCheck->makeEnteringRecord();
@@ -104,28 +102,14 @@ class LaborReportService
         if(!$laborReport&&$importAndExportQRCodeType=='export'){
             //退场时间跨天情况
             $yesterdayDate=Carbon::now()->subDays(1)->format('Y-m-d');
-            $laborReportYesterday=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$yesterdayDate.'%')->orderBy('id','desc')->first();
-//            if (!$laborReportYesterday->group_user_id&&!$laborReportYesterday->verify_at){
-//                LaborReport::query()->where('user_id',$userDutyCheck->user_id)->whereNull('group_user_id')->whereNull('verify_at')->orderBy('id','desc')->delete();
-//                $laborReportYesterday=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$yesterdayDate.'%')->orderBy('id','desc')->first();
-//            }
-//            if (!$laborReportYesterday->check_out_at&&$laborReportYesterday['user_workgroup_id']){
-//                UserDutyCheck::where('user_id',$laborReportYesterday->user_id)->where('type','登出')->where('checked_at','like',Carbon::now()->format('Y-m-d H:i').'%')->orderBy('id','desc')->delete();
-//                return "<h1 style='color: darkred;text-align:center'>您还未退组,暂不可退场,请联系组长!</h1>";
-//            }
+            $laborReportYesterday=LaborReport::query()->where('user_id',$userDutyCheck->user_id)->where('created_at','like',$yesterdayDate.'%')->orderBy('id','desc')->first();
+            if ($laborReportYesterday){
                 $exportReport=LaborReport::exitAndChangeLaborReport($laborReportYesterday,$userDutyCheck);
                 Controller::logS(__METHOD__,"退场更改临时工报表信息__".__FUNCTION__,json_encode([$laborReportYesterday,$userDutyCheck]));
                 if ($exportReport) event(new ExportEvent($exportReport));
+            }
         }
         if($laborReport&&$importAndExportQRCodeType=='export'){
-//            if (!$laborReport->group_user_id&&!$laborReport->verify_at){
-//                LaborReport::where('user_id',$userDutyCheck->user_id)->whereNull('group_user_id')->whereNull('verify_at')->orderBy('id','desc')->delete();
-//                $laborReport=LaborReport::where('user_id',$userDutyCheck->user_id)->where('created_at','like',$dateNow.'%')->orderBy('id','desc')->first();
-//            }
-//            if (!$laborReport['check_out_at']&&$laborReport['user_workgroup_id']){
-//                UserDutyCheck::where('user_id',$laborReport->user_id)->where('type','登出')->where('checked_at','like',Carbon::now()->format('Y-m-d H:i').'%')->orderBy('id','desc')->delete();
-//                return "<h1 style='color: darkred;text-align:center'>您还未退组,暂不可退场,请联系组长!</h1>";
-//            }
             $exportReport=LaborReport::exitAndChangeLaborReport($laborReport,$userDutyCheck);
             Controller::logS(__METHOD__,"退场更改临时工报表信息__".__FUNCTION__,json_encode([$laborReport,$userDutyCheck]));
             if ($exportReport) event(new ExportEvent($exportReport));
@@ -209,8 +193,8 @@ class LaborReportService
     public function 删除($id){
         $laborReport=LaborReport::query()->where('id',$id)->delete();
         if ($laborReport>0)LaborReportStatus::create([
-           'labor_report_id'=>$id,
-           'status'=>'已删除',
+            'labor_report_id'=>$id,
+            'status'=>'已删除',
         ]);
         Controller::logS(__METHOD__,'删除盘点记录时修改盘点任务信息'.__FUNCTION__,json_encode($id));
         return $laborReport;

+ 22 - 38
app/Services/OwnerPriceOperationService.php

@@ -83,7 +83,7 @@ class OwnerPriceOperationService
             $model->load("items");
             /** @var \stdClass $model */
             foreach ($model->items as $item){
-                $columns = ["strategy","amount","unit_id","unit_price","feature","priority","discount_price","odd_price"];
+                $columns = ["strategy","amount","unit_id","unit_price","feature","priority","discount_price"];
                 if ($items[$item->id] ?? false){
                     foreach ($columns as $column){
                         if (!array_key_exists($column,$items[$item->id]))$items[$item->id][$column] = $item[$column];
@@ -107,7 +107,6 @@ class OwnerPriceOperationService
                 $arr["unit_id"] = $item["unit_id"];
                 $arr["unit_price"] = $item["unit_price"];
                 $arr["feature"] = $item["feature"] ?? null;
-                $arr["odd_price"] = $item["odd_price"] ?? null;
                 $arr["priority"] = $item["priority"] ?? 0;
                 $arr["discount_price"] = isset($item["discount_price"]) ? (is_array($item["discount_price"]) ? implode(",",$item["discount_price"]) : $item["discount_price"]) : null;
                 $insert[] = $arr;
@@ -288,7 +287,7 @@ class OwnerPriceOperationService
      *
      *  2:没有总数量存在,都为子项内数量
      *
-     * @param array|object|Model $matchObject  key-val
+     * @param array|object $matchObject  key-val
      * @param array $columnMapping       key-val
      * @param string $ownerId
      * @param string $type
@@ -308,16 +307,13 @@ class OwnerPriceOperationService
      *      区分单据类型,增加字段
      * 六. 2021-03-23 zzd
      *      不严格区分入库出库差异 统一模型
-     * 七. 2021-03-30 zzd
-     *      增加一级二级特征,零头价,满减按总件,附加费用等
      */
     public function matching($matchObject, $columnMapping, $ownerId, $type = '出库', $typeMark = null)
     {
         $units = app("UnitService")->getUnitMapping(["件","箱"]); //获取单位映射集
         $rules = $this->getOwnerPriceOperation($ownerId,$type,$typeMark);//货主下的全部规则
         if (!$rules)return -2;  //规则不存在跳出
-        if ($type == '出库') $total = app("OrderService")->getOrderQuantity($ownerId);//获取该货主本月C端单量
-        else $total = app("StoreService")->getStoreAmount($ownerId);//获取该货主本月入库件数
+        $total = app("OrderService")->getOrderQuantity($ownerId);//获取该货主本月C端单量
         foreach ($rules as $rule){
             if (!$rule->items)continue; //不存在子规则跳出
 
@@ -327,32 +323,34 @@ class OwnerPriceOperationService
             if ($rule->strategy == '特征'){
                 if (app("FeatureService")->matchFeature($rule->feature,$columnMapping,$matchObject)){
                     if ($rule->total_price)return ["id"=>$rule->id,"money"=>$result ? explode(",",$rule->total_discount_price)[key($result)] : $rule->total_price];//按单计价存在,直接返回单总价或减免总价
-                    $money = $this->matchItem($rule,$columnMapping,$matchObject,$units,$ownerId,$result);
+                    $money = $this->matchItem($rule->items,$columnMapping,$matchObject,$units,$ownerId,$result);
                     if ($money>0)return ["id"=>$rule->id,"money"=>$money];
                 };
             }else{
                 if ($rule->total_price)return ["id"=>$rule->id,"money"=>$result ? explode(",",$rule->total_discount_price)[key($result)] : $rule->total_price]; //按单计价存在,直接返回单总价或减免总价
-                $money = $this->matchItem($rule,$columnMapping,$matchObject,$units,$ownerId,$result);
+                $money = $this->matchItem($rule->items,$columnMapping,$matchObject,$units,$ownerId,$result);
                 if ($money>0)return ["id"=>$rule->id,"money"=>$money];
             };
         }
         return $money ?? -7;
     }
     /**
-     * 根据货主 sku寻找箱规并将指定数量切换为箱 返回箱规
+     * 根据货主 sku寻找箱规并将指定数量切换为箱
+     *      不满一箱视为一箱
      *
+     * @param integer $amount
      * @param integer $ownerId
      * @param null|object $commodity
      *
      * @return int
      */
-    private function changeUnit($ownerId,$commodity)
+    private function changeUnit($amount,$ownerId,$commodity)
     {
         if (!$commodity)return -4;
-        if ($commodity->pack_spec)return $commodity->pack_spec;
+        if ($commodity->pack_spec)return ceil($amount/$commodity->pack_spec);
         $pack = app("CommodityService")->getPack($ownerId,$commodity->sku);
         if (!$pack)return -6;
-        return $pack;
+        return ceil($amount/$pack);
     }
 
     /**
@@ -386,28 +384,23 @@ class OwnerPriceOperationService
     /**
      * 匹配子策略
      *
-     * @param Model|\stdClass $obj 策略对象
+     * @param array $rules 策略对象组
      * @param array $columnMapping 映射对象
-     * @param Model $matchObject 被匹配对象
+     * @param array $matchObject 被匹配对象
      * @param array $units 单位集
      * @param integer $ownerId 货主ID
      * @param bool|array $result 满减信息
      *
      * @return double
      */
-    private function matchItem($obj, $columnMapping, $matchObject, $units, $ownerId, $result)
+    private function matchItem($rules, $columnMapping, $matchObject, $units, $ownerId, $result)
     {
+        /** @var Collection $matchObject */
         $matchObject = $this->resetChildNodeMapping($matchObject->toArray(),$columnMapping);
         if (!$matchObject)return -1;
-        $total = 0; //商品总数
-        foreach ($matchObject as $commodity)$total += $commodity[$columnMapping[8]]; //取对象内商品数量总数将其当作子属性插入原对象
-        $surcharge = 0;
+
         $unitName = "";
-        if ($obj->surcharge_unit_id && $obj->surcharge && isset($units[$rule->surcharge_unit_id])){
-            if ($units[$obj->surcharge_unit_id] == '件')$surcharge += $obj->surcharge*$total;
-            else $surcharge += $obj->surcharge;
-        }//耗材附加费
-        foreach ($obj->items as $rule){
+        foreach ($rules as $rule){
             if ($result)$rule->unit_price = explode(",",$rule->discount_price)[key($result)]; //满足满减条件,单价调整为满减单价
 
             if ($rule->strategy=='起步'){
@@ -417,34 +410,25 @@ class OwnerPriceOperationService
                 if ($startNumber)$matchObject=$this->settingCount($matchObject,$columnMapping[8],$startNumber);
                 if ($matchObject)foreach ($matchObject as $package)$money += $package[$columnMapping[8]] * $package["price"];
                 if (!$startNumber && $money<$rule->unit_price)$money = $rule->unit_price;
-                return $money+$surcharge;
+                return $money;
             }
             foreach ($matchObject as &$package){
                 if ($package["price"] ?? false)continue;
                 if (!isset($units[$rule->unit_id]))return -3;
                 if (!$unitName)$unitName = $units[$rule->unit_id];
                 else if ($unitName != $units[$rule->unit_id]) return -3;
-                if ($rule->strategy=='特征'){
-                    $package[$columnMapping[10]] = $total; //设置一个不存在的总数进入原对象
-                    if (!app("FeatureService")->matchFeature($rule->feature,$columnMapping,$package)) continue;
-                }
+                if ($rule->strategy=='特征')if (!app("FeatureService")->matchFeature($rule->feature,$columnMapping,$package)) continue;
                 $package["price"] = $rule->unit_price;
             }
             if ($units[$rule->unit_id] == '箱'){ //为箱时同步商品寻找箱规
                 $amount = 0;
-                foreach ($matchObject as $commodity){
-                    $pack = $this->changeUnit($ownerId,$commodity[$columnMapping[9]]);
-                    if ($rule->odd_price){
-                        $amount += floor($amount/$pack);
-                        $surcharge += $rule->odd_price * ($amount%$pack); //零头附加费
-                    }else$amount += ceil($amount/$pack);
-                }
+                foreach ($matchObject as $commodity)$amount += $this->changeUnit($commodity[$columnMapping[8]],$ownerId,$commodity[$columnMapping[9]]);
                 if ($amount<0)return $amount;
                 $package[$columnMapping[8]] = $amount;
             }
         }
         if ($matchObject){
-            $money = $surcharge;
+            $money = 0;
             foreach ($matchObject as $package)if ($package["price"])$money += $package[$columnMapping[8]] * $package["price"];
         }
         return $money ?? -7;
@@ -497,7 +481,7 @@ class OwnerPriceOperationService
                 $logistic_fee = 0;
                 if ($logistic_fee!==null && $logistic_fee<0)$logistic_fee = null;
 
-                $money = $this->matchItem($rule,Feature::MAPPING["order"],$order,$units,$owner,[$discountIndex=>true]);
+                $money = $this->matchItem($rule->items,Feature::MAPPING["order"],$order,$units,$owner,[$discountIndex=>true]);
                 if ($money>0)$detail->update(["work_fee"=>$money]);
                 else LogService::log(__CLASS__,"处理历史即时账单时发生匹配错误","账单主键:".$detail->id."; 错误代码".$money);
             };

+ 3 - 10
app/Services/StationRuleBatchService.php

@@ -23,6 +23,7 @@ class StationRuleBatchService
         LogService::log(__METHOD__,'getByBatch','波次任务分配1.21:'.json_encode($batch));
         $batchType = $batch['type'] ?? 'null';
         $ownerId = $batch['owner_id'] ?? 'null';
+        if(!$this->isLocationOfRobot($batch))return null;
         LogService::log(__METHOD__,'getByBatch','波次任务分配1.22:'.($this->isLocationOfRobot($batch)));
         $batch->loadMissing('stationTaskBatch');
 //        if($batch['stationTaskBatch'])return null;//? 这行有啥用?
@@ -39,16 +40,10 @@ class StationRuleBatchService
     }
     function isLocationOfRobot(?Batch $batch): bool
     {
-        LogService::log(__METHOD__,'getByBatch','波次任务分配1.21I1:'.json_encode($batch));
         if(!$batch)return false;
-        LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I2:'.json_encode($batch));
         $sql = "select count(*) as count from order_commodities where location like 'IDE%' and order_id in (select id from orders where batch_id in (select id from batches where id = ?))";
-
-        LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I3:');
-        LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I3.2:'.$sql);
         $billDetails = DB::select(DB::raw($sql),[$batch['id']]);
-        LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I4:'.json_encode($batch).json_encode($billDetails).($billDetails[0]->count > 0));
-        return $billDetails[0]->count > 0;
+        return $billDetails[0]->count>0;
     }
 
     function getStationType_toBeTask(Batch $batch): ?StationType{
@@ -70,10 +65,8 @@ class StationRuleBatchService
         $batches=$batches->whereNotIn('id',data_get($batches_inTask,'*.id')??[]);
         foreach ($batches as $batch){
             $stationRuleBatch=$this->getByBatch($batch);
-            if($stationRuleBatch){
-//                if(!$this->isLocationOfRobot($batch))continue;
+            if($stationRuleBatch)
                 $batches_toProcess->push($batch);
-            }
         }
         LogService::log(__METHOD__,'shouldProcess','波次任务分配1.3:'.json_encode($batches_inTask));
         return $batches_toProcess;

+ 7 - 7
app/Services/StationTaskBatchService.php

@@ -208,13 +208,6 @@ class StationTaskBatchService
         return $isFetchedFromRobotics;
     }
 
-    function markProcessed($stationTaskBatch_orCollection)
-    {
-        if (get_class($stationTaskBatch_orCollection)==StationTaskBatch::class){
-            $stationTaskBatch_orCollection = collect([$stationTaskBatch_orCollection]);
-        }
-        $this->markProcessed_byIds(data_get($stationTaskBatch_orCollection, '*.id'));
-    }
     function markProcessing($stationTaskBatch_orCollection)
     {
         if (get_class($stationTaskBatch_orCollection)==StationTaskBatch::class){
@@ -230,6 +223,13 @@ class StationTaskBatchService
             ->whereIn('id', $ids)
             ->update(['status'=>'处理中']);
     }
+    function markProcessed($stationTaskBatch_orCollection)
+    {
+        if (get_class($stationTaskBatch_orCollection)==StationTaskBatch::class){
+            $stationTaskBatch_orCollection = collect([$stationTaskBatch_orCollection]);
+        }
+        $this->markProcessed_byIds(data_get($stationTaskBatch_orCollection, '*.id'));
+    }
     function markProcessed_byIds($ids)
     {
         if(!$ids)$ids=[];

+ 5 - 1
app/Services/StationTaskCommodityService.php

@@ -27,6 +27,8 @@ class StationTaskCommodityService
     private $stationTaskService;
     /** @var MaterialBoxService $materialBoxService */
     private $materialBoxService;
+    /** @var StationTaskBatchService $stationTaskBatchService */
+    private $stationTaskBatchService;
     public function __construct(){
         $this->stationService=null;
         $this->stationTypeService=null;
@@ -97,9 +99,11 @@ class StationTaskCommodityService
         $this->instant($this->stationTypeService,'StationTypeService');
         $this->instant($this->stationService,'StationService');
         $this->instant($this->materialBoxService,'MaterialBoxService');
+        $this->instant($this->stationTaskBatchService,'StationTaskBatchService');
         $stationTaskCommodities_toCreate=new Collection();
         $order_ids=data_get($batch['orders'],'*.id');
         $orderCommodities=OrderCommodity::query()->with('orderBin')->whereIn('order_id',$order_ids)->get();
+        $stationTaskBatch=$this->stationTaskBatchService->get(['batch_id'=>$batch['id']])->first();
         foreach ($orderCommodities as $orderCommodity){
             $stationType=$this->stationTypeService->getForCommodity();
             $station=$this->stationService->getStation_byType($stationType['name']);
@@ -114,7 +118,7 @@ class StationTaskCommodityService
                     'amount'=>$orderCommodity['amount'],
                     'bin_number'=>$orderCommodity['orderBin']['number']??'',
                     'order_id'=>$orderCommodity['order_id'],
-                    'station_task_batch_id'=>$batch['id'],
+                    'station_task_batch_id'=>$stationTaskBatch['id'],
                     'station_task_material_box_id'=>$stationTaskMaterialBoxId,
                     'status'=>'待处理',
                 ])

+ 2 - 1
app/Services/StationTaskMaterialBoxService.php

@@ -81,7 +81,7 @@ class StationTaskMaterialBoxService
             $stationMaterialBoxes_toCreate->push([
                 'station_id'=>$station['id'],
                 'material_box_id'=>$materialBox['id'],
-                'station_task_batch_id'=>$stationTaskBatch['id']??null,
+                'station_task_batch_id'=>$stationTaskBatch['id'],
                 'status'=>'待处理'
             ]);
         }
@@ -153,6 +153,7 @@ class StationTaskMaterialBoxService
     }
     function markProcessed(StationTaskMaterialBox $stationTaskMaterialBox){
         $stationTaskMaterialBox['status'] = '完成';
+        $stationTaskMaterialBox['station_id'] = 4;
         $stationTaskMaterialBox->update();
     }
 

+ 1 - 44
app/Services/StoreService.php

@@ -17,7 +17,6 @@ use Carbon\Carbon;
 use Illuminate\Support\Facades\Cache;
 
 use App\Traits\ServiceAppAop;
-use Illuminate\Support\Facades\DB;
 
 
 class StoreService
@@ -323,11 +322,8 @@ class StoreService
         /** @var \stdClass $store */
         if (!$store || $store->status != "已入库") return false;
         if (OwnerFeeDetail::query()->where("outer_table_name","stores")->where("outer_id",$store->id)->first())return false;
-        $store->loadMissing(["storeItems","warehouse"]);
+        $store->loadMissing("storeItems");
 
-        $amount = 0;
-        if ($store->storeItems)foreach ($store->storeItems as $item)$amount += $item->amount;
-        $this->setStoreAmount($store->owner_id,$amount);
         /** @var OwnerPriceOperationService $service */
         $service = app("OwnerPriceOperationService");
 
@@ -374,43 +370,4 @@ class StoreService
         }
         if (count($insert_param)>0) StoreRejected::query()->insert($insert_param);
     }
-
-    /**
-     * 入库件数丢失补偿逻辑
-     *
-     * @param int $owner
-     */
-    private function storeAmountCompensationLogic($owner)
-    {
-        $query = DB::raw("SELECT sum(amount) total FROM `store_items` WHERE created_at LIKE ?");
-        $statistics = DB::selectOne($query,[$owner,date("Y-m")."%"]);
-        Cache::put(date("Y-m")."|A|".$owner,$statistics->total,2764800);
-    }
-
-    /**
-     * 设置货主下的本月入库件数
-     *
-     * @param int $owner
-     * @param int $amount
-     */
-    public function setStoreAmount($owner, $amount)
-    {
-        $date = date("Y-m");
-        if (!Cache::has($date."|A|".$owner))$this->storeAmountCompensationLogic($owner);//补偿逻辑
-        Cache::increment($date."|A|".$owner,$amount);
-    }
-
-    /**
-     * 获取货主下的本月入库件数
-     *
-     * @param int $owner
-     *
-     * @return int
-     */
-    public function getStoreAmount($owner)
-    {
-        $date = date("Y-m");
-        if (!Cache::has($date."|A|".$owner))$this->storeAmountCompensationLogic($owner);
-        return Cache::get($date."|A|".$owner);
-    }
 }

+ 1 - 1
app/Services/common/QueryService.php

@@ -97,7 +97,7 @@ class QueryService
                     $delete[] = $model->id;
                     continue;
                 }
-                if ($model->operation == "U" && $model->target_id)$delete[] = $model->target_id;
+                if ($model->operation == "U")$delete[] = $model->target_id;
                 $update[] = $model->id;
             }
         }else{

+ 11 - 11
app/UserDutyCheck.php

@@ -23,41 +23,41 @@ class UserDutyCheck extends Model
 
 
     protected $fillable=[
-        'user_id','checked_at','confirmed_by','type','source','workgroup_id',
+        'user_id','checked_at','type','source','workgroup_id','verify_user_id'
     ];
 
-    public function userDetail(){
+    public function userDetail(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
         return $this->belongsTo('App\UserDetail','user_id','user_id');
     }
 
-    public function userLabor(){
+    public function userLabor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
         return $this->belongsTo('App\UserLabor','user_id','user_id');
     }
-    public function userWorkgroup(){
+    public function userWorkgroup(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
         return $this->belongsTo('App\UserWorkgroup','workgroup_id','id');
     }
-    public function laborReport(){
+    public function laborReport(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
         return $this->belongsTo('App\LaborReport','id','user_duty_check_id');
     }
 
-    public function laborEnterCheck(){
-        $this->makeEnteringRecord();
-    }
     //进场创建临时工报表信息
-     function makeEnteringRecord(){
+     function makeEnteringRecord(): LaborReport
+     {
         $userDetail=UserDetail::find($this['user_id']);
         $name=$userDetail['full_name'];
         $mobile_phone=$userDetail['mobile_phone'];
         $identity_number=$userDetail['identity_number'];
         $labor_company_id=UserLabor::where('user_id',$this['user_id'])->value('labor_company_id');
-//        $labor_company=LaborCompany::where('id',$labor_company_id)->value('name');
         $laborReport=new LaborReport([
             'user_id'=>$this['user_id'],
             'name'=>$name,
             'mobile_phone'=>$mobile_phone,
             'identity_number'=>$identity_number,
             'labor_company_id'=>$labor_company_id,
-//            'labor_company'=>$labor_company,
             'user_duty_check_id'=>$this['id'],
         ]);
         $laborReport->save();

+ 1 - 2
app/Waybill.php

@@ -58,8 +58,7 @@ class Waybill extends Model
         'other_charge_remark',
         'deliver_at',
         "district_id",
-        "order_id",
-        "is_to_pay" //0否 1是
+        "order_id"
     ];
 
     public function district()

+ 3 - 5
laravel-echo-server.json

@@ -1,5 +1,5 @@
 {
-	"authHost": "https://localhost",
+	"authHost": "http://localhost",
 	"authEndpoint": "/broadcasting/auth",
 	"clients": [
 		{
@@ -21,14 +21,12 @@
 			"databasePath": "/database/laravel-echo-server.sqlite"
 		}
 	},
-	"devMode": false,
+	"devMode": true,
 	"host": null,
 	"port": "6001",
-	"protocol": "https",
+	"protocol": "http",
 	"socketio": {},
 	"secureOptions": 67108864,
-	"sslCertPath": "/etc/letsencrypt/live/was.baoshi56.com/fullchain.pem",
-	"sslKeyPath": "/etc/letsencrypt/live/was.baoshi56.com/privkey.pem",
 	"sslCertChainPath": "",
 	"sslPassphrase": "",
 	"subscribers": {

+ 3 - 0
laravel-echo-server.lock

@@ -0,0 +1,3 @@
+{
+	"process": 15892
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 64 - 565
package-lock.json


+ 0 - 1
package.json

@@ -33,7 +33,6 @@
     "js-cookie": "^2.2.1",
     "jsbarcode": "^3.11.3",
     "laravel-echo": "^1.8.0",
-    "laravel-echo-server": "^1.6.2",
     "md5": "^2.3.0",
     "moment": "^2.28.0",
     "pusher-js": "^5.1.1",

+ 70 - 70
resources/lang/cn/validation.php

@@ -17,105 +17,105 @@ return [
     'active_url' => ':attribute 不是有效URL',
     'after' => ':attribute 必须是在 :date 之后',
     'after_or_equal' => ':attribute 必须是等于或在 :date 之后',
-    'alpha' => ':attribute may only contain letters.',
-    'alpha_dash' => ':attribute may only contain letters, numbers, dashes and underscores.',
-    'alpha_num' => ':attribute may only contain letters and numbers.',
-    'array' => ':attribute must be an array.',
-    'before' => ':attribute must be a date before :date.',
-    'before_or_equal' => ':attribute must be a date before or equal to :date.',
+    'alpha' => ':attribute 只能包含字母',
+    'alpha_dash' => ':attribute 只能包含字母、数字、破折号和下划线',
+    'alpha_num' => ':attribute 只能包含字母、数字',
+    'array' => ':attribute 必须是数组',
+    'before' => ':attribute 必须是在 :date 之前',
+    'before_or_equal' => ':attribute 必须是等于或在 :date 之前',
     'between' => [
         'numeric' => ':attribute 必须介于 :min 与 :max 之间.',
-        'file' => ':attribute must be between :min and :max kilobytes.',
-        'string' => ':attribute must be between :min and :max characters.',
-        'array' => ':attribute must have between :min and :max items.',
+        'file' => ':attribute 必须介于 :min 与 :max KB 之间',
+        'string' => ':attribute 必须介于 :min 与 :max 字符 之间.',
+        'array' => ':attribute 必须介于 :min 与 :max 之间',
     ],
     'boolean' => ':attribute 请选是或否,必须是布尔值',
-    'confirmed' => ':attribute confirmation does not match.',
+    'confirmed' => ':attribute 确认不匹配',
     'date' => ':attribute 不是有效日期',
-    'date_equals' => ':attribute must be a date equal to :date.',
-    'date_format' => ':attribute does not match the format :format.',
-    'different' => ':attribute and :other must be different.',
+    'date_equals' => ':attribute 日期必须等于 :date.',
+    'date_format' => ':attribute 不匹配格式 :format.',
+    'different' => ':attribute 和 :other 必须不同',
     'digits' => ':attribute 必须是 :digits 位数.',
     'digits_between' => ':attribute 必须介于 :min 与 :max 位之间.',
-    'dimensions' => ':attribute has invalid image dimensions.',
-    'distinct' => ':attribute field has a duplicate value.',
-    'email' => ':attribute must be a valid email address.',
-    'ends_with' => ':attribute must end with one of the following: :values',
+    'dimensions' => ':attribute 图像尺寸无效',
+    'distinct' => ':attribute 字段有重复的值',
+    'email' => ':attribute 必须是有效的电子邮件地址',
+    'ends_with' => ':attribute 必须以下列之一结束: :values',
     'exists' => ':attribute 选择的相关值不存在',
-    'file' => ':attribute must be a file.',
-    'filled' => ':attribute field must have a value.',
+    'file' => ':attribute 必须是文件',
+    'filled' => ':attribute 字段必须有值',
     'gt' => [
-        'numeric' => ':attribute must be greater than :value.',
-        'file' => ':attribute must be greater than :value kilobytes.',
-        'string' => ':attribute must be greater than :value characters.',
-        'array' => ':attribute must have more than :value items.',
+        'numeric' => ':attribute 必须大于 :value',
+        'file' => ':attribute 必须大于 :value KB',
+        'string' => ':attribute 必须大于 :value 字符',
+        'array' => ':attribute 必须有更多 :value',
     ],
     'gte' => [
-        'numeric' => ':attribute must be greater than or equal :value.',
-        'file' => ':attribute must be greater than or equal :value kilobytes.',
-        'string' => ':attribute must be greater than or equal :value characters.',
-        'array' => ':attribute must have :value items or more.',
+        'numeric' => ':attribute 必须大于或等于 :value.',
+        'file' => ':attribute 必须大于或等于 :value KB.',
+        'string' => ':attribute 必须大于或等于 :value 字符.',
+        'array' => ':attribute 必须有 :value 或更多',
     ],
-    'image' => ':attribute must be an image.',
-    'in' => ' :attribute 不在合法值内.',
-    'in_array' => ':attribute field does not exist in :other.',
-    'integer' => ':attribute must be an integer.',
-    'ip' => ':attribute must be a valid IP address.',
-    'ipv4' => ':attribute must be a valid IPv4 address.',
-    'ipv6' => ':attribute must be a valid IPv6 address.',
-    'jsonData' => ':attribute must be a valid JSON string.',
+    'image' => ':attribute 必须是图像',
+    'in' => ' :attribute 不在合法值内',
+    'in_array' => ':attribute 字段不存在 :other.',
+    'integer' => ':attribute 必须为整数',
+    'ip' => ':attribute 必须是有效 IP 地址',
+    'ipv4' => ':attribute 必须是有效 IPv4 地址',
+    'ipv6' => ':attribute 必须是有效 IPv6 地址',
+    'jsonData' => ':attribute 必须是有效json字符串',
     'lt' => [
-        'numeric' => ':attribute must be less than :value.',
-        'file' => ':attribute must be less than :value kilobytes.',
-        'string' => ':attribute must be less than :value characters.',
-        'array' => ':attribute must have less than :value items.',
+        'numeric' => ':attribute 必须小于 :value',
+        'file' => ':attribute 必须小于 :value KB',
+        'string' => ':attribute 必须小于 :value 字符',
+        'array' => ':attribute 必须小于 :value ',
     ],
     'lte' => [
-        'numeric' => ':attribute must be less than or equal :value.',
-        'file' => ':attribute must be less than or equal :value kilobytes.',
-        'string' => ':attribute must be less than or equal :value characters.',
-        'array' => ':attribute must not have more than :value items.',
+        'numeric' => ':attribute 必须小于或等于 :value',
+        'file' => ':attribute 必须小于或等于 :value KB',
+        'string' => ':attribute 必须小于或等于 :value 字符',
+        'array' => ':attribute 不能超过 :value ',
     ],
     'max' => [
-        'numeric' => ':attribute may not be greater than :max.',
-        'file' => ':attribute may not be greater than :max kilobytes.',
+        'numeric' => ':attribute 不能大于 :max',
+        'file' => ':attribute 不能大于 :max KB',
         'string' => ':attribute 不能大于 :max 个字符',
-        'array' => ':attribute may not have more than :max items.',
+        'array' => ':attribute 不能超过 :max ',
     ],
-    'mimes' => ':attribute must be a file of type: :values.',
-    'mimetypes' => ':attribute must be a file of type: :values.',
+    'mimes' => ':attribute 必须是一个类型的文件: :values.',
+    'mimetypes' => ':attribute 必须是一个类型的文件: :values.',
     'min' => [
-        'numeric' => ':attribute must be at least :min.',
-        'file' => ':attribute must be at least :min kilobytes.',
-        'string' => ':attribute must be at least :min characters.',
-        'array' => ':attribute must have at least :min items.',
+        'numeric' => ':attribute 至少 :min',
+        'file' => ':attribute 至少 :min KB',
+        'string' => ':attribute 至少 :min 字符',
+        'array' => ':attribute 必须至少有 :min ',
     ],
-    'not_in' => 'selected :attribute is invalid.',
-    'not_regex' => ':attribute format is invalid.',
+    'not_in' => '挑选 :attribute 是无效的',
+    'not_regex' => ':attribute 格式是无效的',
     'numeric' => ':attribute 必须是数字',
-    'present' => ':attribute field must be present.',
-    'regex' => ':attribute format is invalid.',
+    'present' => ':attribute 字段必须存在',
+    'regex' => ':attribute 格式是无效',
     'required' => ':attribute 字段不能为空',
-    'required_if' => ':attribute field is required when :other is :value.',
-    'required_unless' => ':attribute field is required unless :other is in :values.',
-    'required_with' => ':attribute field is required when :values is present.',
-    'required_with_all' => ':attribute field is required when :values are present.',
+    'required_if' => ':attribute 字段必须存在 当:other 是 :value',
+    'required_unless' => ':attribute 字段是必需的 除非 :other 介于 :values.',
+    'required_with' => '当 :values 存在:attribute 字段是必需的',
+    'required_with_all' => '当 :values 存在 :attribute 字段是必需的',
     'required_without' => ':values 与 :attribute 至少填写一项',
-    'required_without_all' => ':attribute field is required when none of :values are present.',
+    'required_without_all' => '当 :values 不存在 :attribute 字段是必需的',
     'same' => ':attribute 与 :other 必须一致',
     'size' => [
-        'numeric' => ':attribute must be :size.',
-        'file' => ':attribute must be :size kilobytes.',
-        'string' => ':attribute must be :size characters.',
-        'array' => ':attribute must contain :size items.',
+        'numeric' => ':attribute 必须是 :size.',
+        'file' => ':attribute 必须是 :size KB',
+        'string' => ':attribute 必须是 :size 字符',
+        'array' => ':attribute 必须包含 :size ',
     ],
-    'starts_with' => ':attribute must start with one of the following: :values',
+    'starts_with' => ':attribute 必须以下列之一开头: :values',
     'string' => ':attribute 必须是字符串',
-    'timezone' => ':attribute must be a valid zone.',
+    'timezone' => ':attribute 必须是一个有效的区域',
     'unique' => ':attribute 已经存在,不能重复!',
-    'uploaded' => ':attribute failed to upload.',
-    'url' => ':attribute format is invalid.',
-    'uuid' => ':attribute must be a valid UUID.',
+    'uploaded' => ':attribute 未能上传',
+    'url' => ':attribute 格式是无效',
+    'uuid' => ':attribute 必须是有效的UUID',
     'identity_cards' => ':attribute 身份证号错误',
 
     /*

+ 1 - 1
resources/views/customer/project/area.blade.php

@@ -318,4 +318,4 @@
             },
         });
     </script>
-@stop
+@stop

+ 3 - 24
resources/views/customer/project/create.blade.php

@@ -176,7 +176,7 @@
                     discount_type:[
                         "无减免","按单减免","固定减免"
                     ],
-                    feature_type:[],
+                    feature_type:{!! json_encode(\App\Feature::TYPE,JSON_UNESCAPED_UNICODE) !!},
                     logic : ['包含','不包含','等于',"大于","大于等于","小于","小于等于"],
                 },
                 poolMapping:{},//基础数据选择池的映射对象 供展示使用
@@ -721,7 +721,7 @@
                             return;
                         }
                     }
-                    if (!this.model.operation.isRejected && this.model.operation.strategy === '特征' && !this.model.operation.feature){
+                    if (this.model.operation.strategy === '特征' && !this.model.operation.feature){
                         this.$set(this.errors,"feature",["特征未填写"]);
                         return;
                     }
@@ -738,14 +738,6 @@
                             if (i!==0 && !item)this.model.operation.total_discount_price[i] =  this.model.operation.total_discount_price[i-1];
                         })
                     }
-                    if (this.model.operation.surcharge && !this.model.operation.surcharge_unit_id){
-                        this.$set(this.errors,"surcharge_unit_id",["耗材附加费单位未选择"]);
-                        return;
-                    }
-                    if (this.model.operation.surcharge_unit_id && !this.model.operation.surcharge){
-                        this.$set(this.errors,"surcharge_unit_id",["耗材附加费未填写"]);
-                        return;
-                    }
                     if (!this.model.operation.isSingle){
                         for (let i=0;i<this.model.operation.items.length;i++){
                             if (this._verifyOperationItem(i))return;
@@ -794,7 +786,7 @@
                 _verifyOperationItem(itemIndex){//验证作业费子项信息完整
                     let obj = this.model.operation.items[itemIndex];
                     let sign = false;
-                    if (!this.model.operation.isRejected && obj.strategy === '特征' && !obj.feature) {
+                    if (obj.strategy === '特征' && !obj.feature) {
                         this.errors['items.' + itemIndex + '.feature'] = ["必须选择特征"];
                         sign = true;
                     }
@@ -998,19 +990,6 @@
                 },
                 //显示特征选择modal
                 showAddFeatureModal(index){
-                    let types = {!! json_encode(\App\Feature::TYPE,JSON_UNESCAPED_UNICODE) !!};
-                    let typeIn = {!! json_encode(array_keys(\App\Feature::MAPPING['store'])) !!};
-                    let typeOut = {!! json_encode(array_keys(\App\Feature::MAPPING['order'])) !!};
-                    let node = {!! json_encode(\App\Feature::TYPE_NODE) !!};
-                    let temp = [];
-                    if (this.model.operation.operation_type==='入库'){
-                        if (index === -1)typeIn.forEach(t=>{if (types[t] && node.indexOf(t)===-1) temp.push(types[t]);});
-                        else typeIn.forEach(t=>{if (types[t] && node.indexOf(t)!==-1) temp.push(types[t]);});
-                    }else{
-                        if (index === -1)typeOut.forEach(t=>{if (types[t] && node.indexOf(t)===-1) temp.push(types[t]);});
-                        else typeOut.forEach(t=>{if (types[t] && node.indexOf(t)!==-1) temp.push(types[t]);});
-                    }
-                    this.pool.feature_type = temp;
                     if (index === -1){
                         if (!this.model.operation.feature){
                             this.model.operation.features = this._createFeature();

+ 4 - 1
resources/views/customer/project/part/_addFeature.blade.php

@@ -25,7 +25,10 @@
                         </label>
                         <label class="col-2">
                             <select class="form-control form-control-sm" v-model="feature.type">
-                                <option v-for="t in pool.feature_type" :value="t">@{{ t }}</option>
+                                <option v-for="t in pool.feature_type" :value="t"
+                                        v-if="((thisOperationItemIndex===-1 && (t!=='商品名称' && t!=='长' && t!=='商品备注')) || (thisOperationItemIndex!==-1
+                                        && (t=='商品名称' || t=='长' || t=='商品备注'))) && ((model.operation.operation_type=='入库' && t!=='波次类型') || model.operation.operation_type=='出库')">
+                                    @{{ t }}</option>
                             </select>
                         </label>
                         <label class="col-2">

+ 1 - 13
resources/views/customer/project/part/_operation.blade.php

@@ -120,13 +120,9 @@
             </div>
             <div class="row mt-2" v-if="item.strategy!='起步' || (item.strategy=='起步' && item.type==0)">
                 <label class="col-3">单位</label>
-                <label class="col-3 mb-0"><select v-model="item.unit_id" class="form-control" :class="errors['items.'+i+'.unit_id'] ? 'is-invalid' : ''">
+                <label class="col-6 mb-0"><select v-model="item.unit_id" class="form-control" :class="errors['items.'+i+'.unit_id'] ? 'is-invalid' : ''">
                     <option v-for="unit in pool.units" :value="unit.id" v-if="unit.name=='件' || unit.name=='箱'">@{{ unit.name }}</option>
                 </select></label>
-                <label class="col-2 text-right" v-if="model.operation.operation_type=='出库' && poolMapping.units[item.unit_id]=='箱'">零头价</label>
-                <label class="col-3 mb-0" v-if="model.operation.operation_type=='出库' && poolMapping.units[item.unit_id]=='箱'">
-                    <input class="form-control" :class="errors['items.'+i+'.odd_price'] ? 'is-invalid' : ''" v-model="item.odd_price" type="number" step="0.01" min="0">
-                </label>
             </div>
             <div class="row mt-0" v-if="errors['items.'+i+'.unit_id']">
                 <div class="offset-3"><small class="text-danger font-weight-bold ml-3">单位为必选项</small></div>
@@ -166,14 +162,6 @@
         </div>
     </div>
 </div>
-<div class="row mt-3" v-if="model.operation.operation_type=='出库'">
-    <label for="surcharge" class="col-2">耗材附加费</label>
-    <input id="surcharge" type="number" step="0.01" min="0" class="form-control col-3" :class="errors.surcharge ? 'is-invalid' : ''" v-model="model.operation.surcharge">
-    <label for="surcharge_unit_id" class="col-2 text-right">单位</label>
-    <select id="surcharge_unit_id" v-model="model.operation.surcharge_unit_id" class="form-control col-2" :class="errors.surcharge_unit_id ? 'is-invalid' : ''">
-            <option v-for="unit in pool.units" :value="unit.id" v-if="unit.name=='件' || unit.name=='单'">@{{ unit.name }}</option>
-    </select>
-</div>
 <div class="row mt-3">
     <label for="remark" class="col-2">备注</label>
     <textarea id="remark" class="col-6 form-control" v-model="model.operation.remark"></textarea>

+ 0 - 3
resources/views/customer/project/part/_three.blade.php

@@ -75,7 +75,6 @@
                                     </label>
                                     <label>@{{ operation.name }}</label><span class="badge badge-pill badge-danger" v-if="operation.isRejected">退</span>
                                     <label v-if="operation.remark" class="text-secondary">&nbsp;&nbsp;(@{{ operation.remark }})</label>
-                                    <label v-if="operation.surcharge">耗材附加费:<b>@{{ operation.surcharge }}</b>/@{{ poolMapping.units ? poolMapping.units[operation.surcharge_unit_id] : '' }}</label>
                                 </div>
                                 <div class="col-1">
                                     <span class="cursor-pointer text-danger font-weight-bold"
@@ -122,7 +121,6 @@
                                     </label>
                                     <label>@{{ operation.name }}</label>
                                     <label v-if="operation.remark" class="text-secondary">&nbsp;&nbsp;(@{{ operation.remark }})</label>
-                                    <label v-if="operation.surcharge">耗材附加费:<b>@{{ operation.surcharge }}</b>/@{{ poolMapping.units ? poolMapping.units[operation.surcharge_unit_id] : '' }}</label>
                                 </div>
                                 <div class="col-1">
                                     <span class="cursor-pointer text-danger font-weight-bold"
@@ -145,7 +143,6 @@
                                         <div class="col-10">
                                             <label>@{{ item.strategy }}<span v-if="item.strategy!='起步'">续费</span></label>:
                                             <span v-if="item.amount > 0"><b>@{{ item.amount }}</b>&nbsp;@{{ poolMapping.units ? poolMapping.units[item.unit_id] : '' }} /</span><b>&nbsp;@{{ item.unit_price }}</b>元
-                                            <span class="badge badge-secondary" v-if="item.odd_price">零头价:@{{ item.odd_price }}元</span>
                                             <span v-if="operation.isDiscount">&nbsp;(满减单价:
                                                 <span v-for="(value,k) in item.discount_price">
                                                     <span v-if="k!=0">,</span>

+ 23 - 3
resources/views/personnel/checking-in/createReplenishClock.blade.php

@@ -6,7 +6,7 @@
         @component('personnel.checking-in.menuChecking-in')@endcomponent
     </div>
     <div class="container-fluid" id="list">
-        <div class="card col-md-10 offset-md-1">
+        <div class="card col-md-10 offset-1">
             <div class="card-body">
                 <div class="form-group row">
                     <input v-model="full_name" class="col-6 offset-2 form-control" type="text" placeholder="按名称搜索临时工">
@@ -21,7 +21,8 @@
                         <th>最近打卡时间</th>
                         <th>输入补卡时间</th>
                         <th>添加所需备注</th>
-                        <th>类型</th>
+                        <th>补卡类型</th>
+                        <th>工作组</th>
                         <th>操作</th>
                     </tr>
                     </thead>
@@ -45,10 +46,18 @@
                             <select :class="{ 'is-invalid' : errors.type && errors.type.length>0 }" v-model="userLabor.userDutyCheck_type" class="form-control">
                                 <option value="">请选择</option>
                                 <option value="登入">登入</option>
+                                <option value="进组">进组</option>
+                                <option value="退组">退组</option>
                                 <option value="登出">登出</option>
                             </select>
                             <small v-if="errors.type && errors.type.length>0 " class="text-danger">@{{ errors.type[0] }}</small>
                         </td>
+                        <td>
+                            <select :class="{ 'is-invalid' : errors.type && errors.type.length>0 }" v-model="userLabor.userWorkGroup" class="form-control">
+                                <option v-for="userWorkGroup in userWorkGroups" :value="userWorkGroup.id">@{{ userWorkGroup.name }}</option>
+                            </select>
+                            <small v-if="errors.type && errors.type.length>0 " class="text-danger">@{{ errors.type[0] }}</small>
+                        </td>
                         <td><button @click="storeReplenishClock(userLabor)" class="btn btn-info w-100">提交补卡</button></td>
                     </tr>
                     </tbody>
@@ -66,6 +75,11 @@
                 full_name:'',
                 userLabors:[],
                 errors:{'checked_at':[],'type':[],},
+                userWorkGroups:[
+                        @foreach($userWorkGroups as $userWorkGroup)
+                    {id:'{{$userWorkGroup->id}}',name:'{{$userWorkGroup->name}}'},
+                    @endforeach
+                ]
             },
             methods:{
                 checkUserLabors(){
@@ -103,8 +117,14 @@
                     let user_id=userLabor.user_id;
                     let type=userLabor.userDutyCheck_type;
                     let remark=userLabor.laborReport_remark;
+                    let userWorkGroup=userLabor.userWorkGroup;
+                    if ((type==='进组')&& !userWorkGroup){
+                        tempTip.setDuration(4000);
+                        tempTip.show('工作组不可为空!');
+                        return;
+                    }
                     let _this=this;
-                    axios.post("{{url('personnel/checking-in/storeReplenishClock')}}",{user_id:user_id,checked_at:checked_at,type:type,remark:remark})
+                    axios.post("{{url('personnel/checking-in/storeReplenishClock')}}",{user_id:user_id,checked_at:checked_at,type:type,remark:remark,userWorkGroup:userWorkGroup})
                         .then(function (response) {
                             if (response.data.success){
                                 _this.userLabors.every(function (userLabor) {

+ 10 - 2
resources/views/procurement/procurement/index.blade.php

@@ -85,7 +85,13 @@
                             <span v-else>-</span>
                     </div>
                 </td>
+                <td>
+                    <span v-if="procurement_type[procurement.type]=='询价单' && procurement.supplier" >@{{ procurement.supplier.name ??  '' }}</span>
+                </td>
                 <td>@{{ procurement.quantity }}</td>
+                <td>
+                    <span v-if="procurement_type[procurement.type]=='询价单'">@{{ procurement.cost_price }}</span>
+                </td>
                 <td><span>@{{ procurement.unit_price }}</span></td>
                 <td><span v-if="procurement.deliver_amount">@{{ procurement.deliver_amount }}</span></td>
                 <td><span>@{{ procurement.quantity*procurement.unit_price }}</span></td>
@@ -95,9 +101,9 @@
                 <td><span v-if="procurement.owner_material.owner.customer">@{{ procurement.owner_material.owner.customer.phone }}</span></td>
                 <td>
                     <span v-if="procurement_status[procurement.status]!='订单取消'">
-                        <span class="btn btn-sm btn-outline-danger" v-if="!procurement.supplier_id"
+                        <span class="btn btn-sm btn-outline-danger" v-if="procurement.status<3"
                               @click="cancel(procurement.id,procurement.type,procurement.code)">取消</span>
-                        <span class="btn btn-sm btn-outline-success" v-if="procurement_type[procurement.type]=='询价单' && !procurement.cost_price"
+                        <span class="btn btn-sm btn-outline-success" v-if="procurement_type[procurement.type]=='询价单' && procurement.isFinishEnquiry"
                               @click="initiateProcurement(procurement)">发起采购</span>
                     </span>
                 </td>
@@ -203,7 +209,9 @@
                     {name: 'special', value: '特殊要求', class: 'text-center'},
                     {name: 'specification', value: '材质规格', class: 'text-center'},
                     {name: '附件', value: '附件', class: 'text-center'},
+                    {name: 'supplier', value: '供应商', class: 'text-center'},
                     {name: 'quantity', value: '采购数量', neglect: true,class: 'text-center'},
+                    {name: 'offer', value: '采购单价(元)', neglect: true,class: 'text-center'},
                     {name: 'unit_price', value: '销售单价(元)', neglect: true,class: 'text-center'},
                     {name: '', value: '送货数量', neglect: true,class: 'text-center'},
                     {name: '', value: '销售总价(元)', neglect: true,class: 'text-center'},

+ 1 - 0
resources/views/station/monitor/show.blade.php

@@ -321,6 +321,7 @@
                     return this.station['current_station_task'];
                 },
                 batchCode(){
+                    if(!this.task)return;
                     let batches = this.task.station_task_batches;
                     if(batches
                         && Array.isArray(batches)

+ 1 - 1
resources/views/test.blade.php

@@ -102,4 +102,4 @@
     };
 </script>
 </body>
-</html>
+</html>

+ 2 - 2
tests/webApi/thirdPart/haiq/pickStation.http

@@ -14,10 +14,10 @@
 
 
 
-POST https://was.baoshi56.com/api/thirdPart/haiq/pickStation/processed
+POST http://bswas/api/thirdPart/haiq/pickStation/processed
 Content-Type: application/json
 
-{"workStation": "1", "binCode":"IDE0005680", "success": true, "created_at":"2021-56-24 05-03-15", "exception": "", "is_in_plan":true}
+{"workStation": "1", "binCode":"IDE0005714", "success": true, "created_at":"2021-56-24 05-03-15", "exception": "", "is_in_plan":true}
 ###
 
 

+ 1 - 1
webpack.mix.js

@@ -19,7 +19,7 @@ mix.copy('resources/images','public/images');
 mix.copy('resources/icon/faviconc.ico','public/faviconc.ico');
 mix.js('resources/js/trix.js','public/js/trix.js');
 mix.js('resources/js/echarts.js','public/js/echarts.js');
-mix.copy('resources/sass/trix.css','public/css/trix.css');
+mix.copy('resources/sass/trix.css','public/css/initLaborReportsCountingRecords');
 mix.copy('resources/js/queryForm/queryForm.js','public/js/queryForm/queryForm.js');
 mix.copy('resources/js/queryForm/export.js','public/js/queryForm/export.js');
 mix.js('resources/js/queryForm/header.js','public/js/queryForm/header.js');

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.