|
|
|
@ -6,6 +6,7 @@ use App\Http\Controllers\API\PEISApiController;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Http\Controllers\API\H5\FenzhenController as fzc;
|
|
|
|
use App\Http\Controllers\API\H5\FenzhenController as fzc;
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
@ -79,7 +80,7 @@ class FenzhenController extends Controller
|
|
|
|
$table_list=$res['data']['table1'];
|
|
|
|
$table_list=$res['data']['table1'];
|
|
|
|
$clinic_list=$res['data']['table2'];
|
|
|
|
$clinic_list=$res['data']['table2'];
|
|
|
|
$table_list3=$res['data']['table3'];
|
|
|
|
$table_list3=$res['data']['table3'];
|
|
|
|
// dd(json_encode($table_list3,JSON_UNESCAPED_UNICODE));
|
|
|
|
// dd(json_encode($res['data'],JSON_UNESCAPED_UNICODE));
|
|
|
|
$template_path = Storage::path('public/excel/check_time.xlsx');
|
|
|
|
$template_path = Storage::path('public/excel/check_time.xlsx');
|
|
|
|
$spreadsheet = IOFactory::load($template_path);
|
|
|
|
$spreadsheet = IOFactory::load($template_path);
|
|
|
|
$worksheet = $spreadsheet->getActiveSheet();
|
|
|
|
$worksheet = $spreadsheet->getActiveSheet();
|
|
|
|
@ -156,8 +157,9 @@ class FenzhenController extends Controller
|
|
|
|
$shiji_timecount=0;
|
|
|
|
$shiji_timecount=0;
|
|
|
|
$chaoshi_timecount=0;
|
|
|
|
$chaoshi_timecount=0;
|
|
|
|
$weichaoshi_count=0;
|
|
|
|
$weichaoshi_count=0;
|
|
|
|
|
|
|
|
$tj_numbers=[];
|
|
|
|
foreach ($table_list3 as $table_list3_i) {
|
|
|
|
foreach ($table_list3 as $table_list3_i) {
|
|
|
|
|
|
|
|
$tj_numbers[]=$table_list3_i['uuid'];
|
|
|
|
$biaozhun_timecount+=$table_list3_i['clinic_time'];
|
|
|
|
$biaozhun_timecount+=$table_list3_i['clinic_time'];
|
|
|
|
$shiji_timecount+=$table_list3_i['used_time'];
|
|
|
|
$shiji_timecount+=$table_list3_i['used_time'];
|
|
|
|
$chaoshi_timecount+=$table_list3_i['timeout'];
|
|
|
|
$chaoshi_timecount+=$table_list3_i['timeout'];
|
|
|
|
@ -197,6 +199,59 @@ class FenzhenController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
$worksheet->getStyle('AC3:AJ' . ($row +2))->applyFromArray($styleArray);
|
|
|
|
$worksheet->getStyle('AC3:AJ' . ($row +2))->applyFromArray($styleArray);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//准时到检率
|
|
|
|
|
|
|
|
$tj_numbers=implode(",", $tj_numbers);
|
|
|
|
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
|
|
|
|
$wait=$peis::Get($peis::Api('报告时间计算',$tj_numbers),'460107000001',"报告时间计算");
|
|
|
|
|
|
|
|
$jianhou_sign_count=0;
|
|
|
|
|
|
|
|
$zhunshi_count=0;
|
|
|
|
|
|
|
|
//dd($wait);
|
|
|
|
|
|
|
|
if(isset($wait['Data'])){
|
|
|
|
|
|
|
|
$jianhou_sign_count=count($wait['Data']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($table_list3 as $key=> $fz_value) {
|
|
|
|
|
|
|
|
foreach ($wait['Data'] as $index => $sx_value) {
|
|
|
|
|
|
|
|
if($fz_value['uuid']==$sx_value['体检号']){
|
|
|
|
|
|
|
|
if($date.' '.$fz_value['end_time']>$sx_value['检后签到时间']){
|
|
|
|
|
|
|
|
$zhunshi_count++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AL' . 3,$date , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AM' . 3,$zhunshi_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AN' . 3,$jianhou_sign_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AO' . 3,round($zhunshi_count/$jianhou_sign_count, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->getStyle('AL3:AO' . 3)->applyFromArray($styleArray);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//预约率
|
|
|
|
|
|
|
|
$yyl_yuyue_count=0;//预约人数
|
|
|
|
|
|
|
|
$yyl_tj_count=0;//体检总人数
|
|
|
|
|
|
|
|
$yuyueList=DB::table('orders')->where(['appointment_date'=>$date])->whereIn('status',[2,4])->whereNotNull(['appointment_number'])->get();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$yyl_yuyue_count=count($yuyueList);
|
|
|
|
|
|
|
|
$yyl_tj_count=$usercount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AL' . 7,$date , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AM' . 7,$yyl_yuyue_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AN' . 7,$yyl_tj_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AO' . 7,round($yyl_yuyue_count/$yyl_tj_count, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->getStyle('AL7:AO' . 7)->applyFromArray($styleArray);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//预约准时率
|
|
|
|
|
|
|
|
$yyzsl_ren_count=0;//预约准时到达人数
|
|
|
|
|
|
|
|
$yyzsl_zong_count=0;//预约总人数
|
|
|
|
|
|
|
|
$yyzsl_zong_count=$yyl_yuyue_count;
|
|
|
|
|
|
|
|
foreach ($yuyueList as $key=> $yy_value) {
|
|
|
|
|
|
|
|
if($yy_value->appointment_date.' '.$yy_value->appointment_time > $yy_value->check_time){
|
|
|
|
|
|
|
|
$yyzsl_ren_count++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AL' . 11,$date , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AM' . 11,$yyzsl_ren_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AN' . 11,$yyzsl_zong_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->setCellValueExplicit('AO' . 11,round($yyzsl_ren_count/$yyzsl_zong_count, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
|
|
|
|
|
|
|
|
$worksheet->getStyle('AL11:AO' . 11)->applyFromArray($styleArray);
|
|
|
|
|
|
|
|
|
|
|
|
$file_name = Str::orderedUuid();
|
|
|
|
$file_name = Str::orderedUuid();
|
|
|
|
$dir_path = "public/excel/" . date('Ym') . '/' . $file_name;
|
|
|
|
$dir_path = "public/excel/" . date('Ym') . '/' . $file_name;
|
|
|
|
|