|
|
|
|
@ -18,6 +18,7 @@ use App\Models\ManagerProject;
|
|
|
|
|
use App\Models\OrderItems;
|
|
|
|
|
use App\Models\Orders;
|
|
|
|
|
use App\Models\Paramedic;
|
|
|
|
|
use App\Models\ParamedicLevel;
|
|
|
|
|
use App\Models\Patient;
|
|
|
|
|
use App\Models\Product;
|
|
|
|
|
use App\Models\ProductItems;
|
|
|
|
|
@ -100,24 +101,25 @@ class OrdersController extends CommonController
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/manager/get-badges",
|
|
|
|
|
* summary="V2-获取首页数量角标",
|
|
|
|
|
* description="获取首页数量角标",
|
|
|
|
|
* path="/manager/get-project-orders-count/{project_id}",
|
|
|
|
|
* summary="V2-获取医院订单数量角标",
|
|
|
|
|
* description="获取医院订单数量角标",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="query", @OA\Schema(type="integer"), required=true, description="医院id"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="获取首页数量角标"
|
|
|
|
|
* description="获取医院订单数量角标"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getBadges()
|
|
|
|
|
public function getProjectOrdersCount($project_id)
|
|
|
|
|
{
|
|
|
|
|
$orders_count = [];
|
|
|
|
|
$orders_count["unconfirmed"] = 0;
|
|
|
|
|
$orders_count["unassigned"] = 0;
|
|
|
|
|
$orders_count["ongoing"] = 0;
|
|
|
|
|
$orders_count["finished"] = 0;
|
|
|
|
|
$orders_count["all"] = (new Orders())->ofProject($project_id)->count();
|
|
|
|
|
$orders_count["pending"] = (new Orders())->ofProject($project_id)->whereIn("status", [Orders::STATUS_UNCONFIRMED, Orders::STATUS_UNASSIGNED])->count();
|
|
|
|
|
$orders_count["ongoing"] = (new Orders())->ofProject($project_id)->where("status", Orders::STATUS_ONGOING)->count();
|
|
|
|
|
$orders_count["finished"] = (new Orders())->ofProject($project_id)->where("status", Orders::STATUS_ONGOING)->count();
|
|
|
|
|
|
|
|
|
|
return response()->json(compact("orders_count"));
|
|
|
|
|
}
|
|
|
|
|
@ -345,6 +347,7 @@ class OrdersController extends CommonController
|
|
|
|
|
* description="获取护工",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="path", @OA\Schema(type="string"), required=true, description="医院id"),
|
|
|
|
|
* @OA\Parameter(name="keyword", in="query", @OA\Schema(type="string"), required=true, description=""),
|
|
|
|
|
* @OA\Parameter(name="page", in="query", @OA\Schema(type="integer"), required=false, description="当前页码,默认为1"),
|
|
|
|
|
* @OA\Parameter(name="page_size", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为5"),
|
|
|
|
|
* @OA\Parameter(name="has_ongoing_orders", in="query", @OA\Schema(type="integer"), required=false, description="是否空闲的筛选,枚举[0,1]"),
|
|
|
|
|
@ -1664,7 +1667,7 @@ class OrdersController extends CommonController
|
|
|
|
|
/**
|
|
|
|
|
* @OA\POST(
|
|
|
|
|
* path="/manager/cancel-order/{id}",
|
|
|
|
|
* summary="取消订单",
|
|
|
|
|
* summary="V2-取消订单",
|
|
|
|
|
* description="取消订单",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="id", in="path", @OA\Schema(type="integer"), required=true, description="订单id"),
|
|
|
|
|
@ -2093,22 +2096,45 @@ class OrdersController extends CommonController
|
|
|
|
|
return response()->json($approval);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/manager/get-project-paramedic-levels/{project_id}",
|
|
|
|
|
* summary="V2-获取医院护工等级",
|
|
|
|
|
* description="获取医院护工等级",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="query", @OA\Schema(type="string"), required=true, description="医院ID"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="获取医院护工等级"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getProjectParamedicLevels($project_id)
|
|
|
|
|
{
|
|
|
|
|
$paramedic_levels = ParamedicLevel::where("project_id", $project_id)->orderBy("myindex")->get();
|
|
|
|
|
return response()->json($paramedic_levels->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\POST(
|
|
|
|
|
* path="/manager/create-paramedic",
|
|
|
|
|
* summary="新增护工",
|
|
|
|
|
* path="/manager/create-paramedic/{project_id}",
|
|
|
|
|
* summary="V2-新增护工",
|
|
|
|
|
* description="",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="path", @OA\Schema(type="integer"), required=true, description="医院/项目ID"),
|
|
|
|
|
* @OA\Parameter(name="name", in="query", @OA\Schema(type="string"), required=true, description="姓名"),
|
|
|
|
|
* @OA\Parameter(name="id_card_number", in="query", @OA\Schema(type="string"), required=true, description="身份证号"),
|
|
|
|
|
* @OA\Parameter(name="mobile", in="query", @OA\Schema(type="string"), required=true, description="手机号码"),
|
|
|
|
|
* @OA\Parameter(name="join_at", in="query", @OA\Schema(type="string"), required=true, description="入职日期"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="query", @OA\Schema(type="integer"), required=true, description="医院/项目ID"),
|
|
|
|
|
* @OA\Parameter(name="work_years", in="query", @OA\Schema(type="string"), required=true, description="护理经验年限"),
|
|
|
|
|
* @OA\Parameter(name="paramedic_level_id", in="query", @OA\Schema(type="integer"), required=true, description="项目护工级别ID"),
|
|
|
|
|
* @OA\Parameter(name="bank", in="query", @OA\Schema(type="string"), required=false, description="开户行"),
|
|
|
|
|
* @OA\Parameter(name="account", in="query", @OA\Schema(type="string"), required=false, description="银行卡号"),
|
|
|
|
|
* @OA\Parameter(name="idcard_front", in="query", @OA\Schema(type="integer"), required=true, description="身份证正面图片ID"),
|
|
|
|
|
* @OA\Parameter(name="idcard_back", in="query", @OA\Schema(type="integer"), required=true, description="身份证反面图片ID"),
|
|
|
|
|
* @OA\Parameter(name="idcard_front", in="query", @OA\Schema(type="integer"), required=false, description="身份证正面图片ID"),
|
|
|
|
|
* @OA\Parameter(name="idcard_back", in="query", @OA\Schema(type="integer"), required=false, description="身份证反面图片ID"),
|
|
|
|
|
* @OA\Parameter(name="has_health_certificate", in="query", @OA\Schema(type="integer"), required=true, description="是否持有健康证"),
|
|
|
|
|
* @OA\Parameter(name="has_work_certificate", in="query", @OA\Schema(type="integer"), required=true, description="是否是有技能资格证"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="新增护工"
|
|
|
|
|
@ -2154,12 +2180,46 @@ class OrdersController extends CommonController
|
|
|
|
|
/**
|
|
|
|
|
* @OA\POST(
|
|
|
|
|
* path="/manager/upload-image",
|
|
|
|
|
* summary="上传图片",
|
|
|
|
|
* description="",
|
|
|
|
|
* summary="V2-上传图片",
|
|
|
|
|
* description="上传图片",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="folder", in="query", @OA\Schema(type="string"), required=true, description="文件存放目录:[public/manager],public表示可以公开查看的,一般用于头像等公开图片,manager是需要鉴权后查看的,一般用于身份证、资格证书等非公开图片"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="上传图片"
|
|
|
|
|
* description="上传图片",
|
|
|
|
|
* content={
|
|
|
|
|
* @OA\MediaType(
|
|
|
|
|
* mediaType="application/json",
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="id",
|
|
|
|
|
* type="integer",
|
|
|
|
|
* description="文件存储id"
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="folder",
|
|
|
|
|
* type="string",
|
|
|
|
|
* description="文件存储目录"
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="name",
|
|
|
|
|
* type="string",
|
|
|
|
|
* description="文件名"
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="public_path",
|
|
|
|
|
* type="string",
|
|
|
|
|
* description="公开访问路径,如果为null,表示不可公开访问"
|
|
|
|
|
* ),
|
|
|
|
|
* example={
|
|
|
|
|
* "id": "1",
|
|
|
|
|
* "folder": "public",
|
|
|
|
|
* "name": "eufgw83ascasc.jpg",
|
|
|
|
|
* "public_path": "/storage/eufgw83ascasc.jpg"
|
|
|
|
|
* }
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* }
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
@ -2187,13 +2247,18 @@ class OrdersController extends CommonController
|
|
|
|
|
|
|
|
|
|
$upload = new Uploads();
|
|
|
|
|
$upload->original_name = $original_name;
|
|
|
|
|
$upload->folder = $request->folder ? $request->folder : "";
|
|
|
|
|
$upload->folder = $save_folder;
|
|
|
|
|
$upload->name = $name;
|
|
|
|
|
$upload->extension = $extension;
|
|
|
|
|
$upload->creator_type = get_class($this->manager);
|
|
|
|
|
$upload->creator_id = $this->manager->id;
|
|
|
|
|
$upload->size = Storage::size($save_folder . "/" . $name);
|
|
|
|
|
$upload->save();
|
|
|
|
|
if ($save_folder == "public") {
|
|
|
|
|
$upload->public_path = "/storage/" . $name;
|
|
|
|
|
} else {
|
|
|
|
|
$upload->public_path = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return response()->json($upload);
|
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
|
|