|
@@ -46,27 +46,44 @@ class Jjhc {
|
|
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
|
|
$dataapi = new DataApi();
|
|
|
for ($index = 0; $index <= count($datas); $index++) {
|
|
|
- echo "正在查询第" . ($index + 1) . "人({$datas[$index][3]})的失业险\r\n";
|
|
|
- $res = $dataapi->queryUnemploymentInsuranceByIdAndTime($datas[$index][3],'202201','202301');
|
|
|
- if($res){
|
|
|
- $i = 0;
|
|
|
- $months = [];
|
|
|
- if(count($res['data']) > 0){
|
|
|
- foreach ($res['data'] as $k => $v){
|
|
|
- if(strpos($v['AAB069'],"晋华") !== false || strpos($v['AAB069'],"渠梁") !== false){
|
|
|
- $i++;
|
|
|
- array_push($months,$v['AAE003']);
|
|
|
+ $cards_list = [];
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$datas[$index][1]})的出生日期\r\n";
|
|
|
+ $info = Db::table('new_talent_info ti')->leftJoin('un_enterprise ue','ti.enterprise_id = ue.id')->where("ue.type = 2 and ti.name = '{$datas[$index][1]}'")->find();
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$datas[$index][1]}----{$info['birthday']})的证件号\r\n";
|
|
|
+ $cards = $dataapi->IDNumber($datas[$index][1],date("Ymd",strtotime($info['birthday'])));
|
|
|
+ if($cards['code'] == '01' && count($cards['data']) >= 1){
|
|
|
+ foreach ($cards['data'] as $card){
|
|
|
+ array_push($cards_list,$card['aac147']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ array_push($cards_list,$datas[$index][3]);
|
|
|
+ array_push($cards_list,substr($datas[$index][3],4));
|
|
|
+ $cards_list = array_unique($cards_list);
|
|
|
+ foreach ($cards_list as $v){
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$v})的失业险\r\n";
|
|
|
+ $res = $dataapi->queryUnemploymentInsuranceByIdAndTime($v,'202201','202301');
|
|
|
+ Db::table('data_check_log')->save(['realname' => $datas[$index][1],'card' => $card['aac147'],'params' => json_encode(['card' => $v,'start' => '202201','end' => '202301']), 'result' => json_encode($res),'createTime' => date("Y-m-d H:i:s",time())]);
|
|
|
+ if($res){
|
|
|
+ $i = 0;
|
|
|
+ $months = [];
|
|
|
+ if(count($res['data']) > 0){
|
|
|
+ foreach ($res['data'] as $k => $v){
|
|
|
+ if(strpos($v['AAB069'],"晋华") !== false || strpos($v['AAB069'],"渠梁") !== false){
|
|
|
+ $i++;
|
|
|
+ array_push($months,$v['AAE003']);
|
|
|
+ }
|
|
|
}
|
|
|
+ sort($months);
|
|
|
+ $res_str = "2022年共缴费{$i}个月,分别是:".implode('、',$months);
|
|
|
+ echo "第". ($index + 1) . "失业险整理完毕,姓名:{$datas[$index][1]},".$res_str."\r\n";
|
|
|
+ $sheet->setCellValue('F' . ($index+1), $res_str);
|
|
|
+ break;
|
|
|
}
|
|
|
- sort($months);
|
|
|
- $res_str = "2022年共缴费{$i}个月,分别是:".implode('、',$months);
|
|
|
- }else{
|
|
|
- $res_str = "2022年共缴费0个月";
|
|
|
}
|
|
|
- echo "第". ($index + 1) . "失业险整理完毕,姓名:{$datas[$index][1]},".$res_str."\r\n";
|
|
|
- $sheet->setCellValue('F' . ($index+1), $res_str);
|
|
|
+ echo "第". ($index + 1) . "失业险整理完毕,姓名:{$datas[$index][1]},2022年共缴费0个月\r\n";
|
|
|
+ $sheet->setCellValue('F' . ($index+1), "2022年共缴费0个月");
|
|
|
+ sleep(3);
|
|
|
}
|
|
|
- sleep(2);
|
|
|
}
|
|
|
$writer->save($path . "/test.xlsx");
|
|
|
return false;
|
|
@@ -79,28 +96,45 @@ class Jjhc {
|
|
|
$datas = $sheet->toArray();
|
|
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
|
|
$dataapi = new DataApi();
|
|
|
- for ($index = 0; $index < count($datas); $index++) {
|
|
|
- echo "正在查询第" . ($index+1) . "人({$datas[$index][3]})的养老险\r\n";
|
|
|
- $res = $dataapi->queryOldAgeSecurityInsuranceByIdAndTime($datas[$index][3],'202201','202212');
|
|
|
- if($res){
|
|
|
- $i = 0;
|
|
|
- $months = [];
|
|
|
- if(count($res['data']) > 0){
|
|
|
- foreach ($res['data'] as $k => $v){
|
|
|
- if(strpos($v['AAB004'],"晋华") !== false || strpos($v['AAB004'],"渠梁") !== false){
|
|
|
- $i++;
|
|
|
- array_push($months,$v['AAE003']);
|
|
|
+ for ($index = 0; $index <= count($datas); $index++) {
|
|
|
+ $cards_list = [];
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$datas[$index][1]})的出生日期\r\n";
|
|
|
+ $info = Db::table('new_talent_info ti')->leftJoin('un_enterprise ue','ti.enterprise_id = ue.id')->where("ue.type = 2 and ti.name = '{$datas[$index][1]}'")->find();
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$datas[$index][1]}----{$info['birthday']})的证件号\r\n";
|
|
|
+ $cards = $dataapi->IDNumber($datas[$index][1],date("Ymd",strtotime($info['birthday'])));
|
|
|
+ if($cards['code'] == '01' && count($cards['data']) >= 1){
|
|
|
+ foreach ($cards['data'] as $card){
|
|
|
+ array_push($cards_list,$card['aac147']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ array_push($cards_list,$datas[$index][3]);
|
|
|
+ array_push($cards_list,substr($datas[$index][3],4));
|
|
|
+ $cards_list = array_unique($cards_list);
|
|
|
+ foreach ($cards_list as $v){
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$v})的养老险\r\n";
|
|
|
+ $res = $dataapi->queryOldAgeSecurityInsuranceByIdAndTime($v,'202201','202212');
|
|
|
+ Db::table('data_check_log')->save(['realname' => $datas[$index][1],'card' => $card['aac147'],'params' => json_encode(['card' => $v,'start' => '202201','end' => '202212']), 'result' => json_encode($res),'createTime' => date("Y-m-d H:i:s",time())]);
|
|
|
+ if($res){
|
|
|
+ $i = 0;
|
|
|
+ $months = [];
|
|
|
+ if(count($res['data']) > 0){
|
|
|
+ foreach ($res['data'] as $k => $v){
|
|
|
+ if(strpos($v['AAB004'],"晋华") !== false || strpos($v['AAB004'],"渠梁") !== false){
|
|
|
+ $i++;
|
|
|
+ array_push($months,$v['AAE003']);
|
|
|
+ }
|
|
|
}
|
|
|
+ sort($months);
|
|
|
+ $res_str = "2022年共缴费{$i}个月,分别是:".implode('、',$months);
|
|
|
+ echo "第". ($index + 1) . "养老险整理完毕,姓名:{$datas[$index][1]},".$res_str."\r\n";
|
|
|
+ $sheet->setCellValue('E' . ($index+1), $res_str);
|
|
|
+ break;
|
|
|
}
|
|
|
- sort($months);
|
|
|
- $res_str = "2022年共缴费{$i}个月,分别是:".implode('、',$months);
|
|
|
- }else{
|
|
|
- $res_str = "2022年共缴费0个月";
|
|
|
}
|
|
|
- echo "第". ($index + 1) . "养老险整理完毕,姓名:{$datas[$index][1]},".$res_str."\r\n";
|
|
|
- $sheet->setCellValue('E' . ($index+1), $res_str);
|
|
|
+ echo "第". ($index + 1) . "养老险整理完毕,姓名:{$datas[$index][1]},2022年共缴费0个月\r\n";
|
|
|
+ $sheet->setCellValue('E' . ($index+1), "2022年共缴费0个月");
|
|
|
+ sleep(3);
|
|
|
}
|
|
|
- sleep(2);
|
|
|
}
|
|
|
$writer->save($path . "/test.xlsx");
|
|
|
return false;
|
|
@@ -138,6 +172,22 @@ class Jjhc {
|
|
|
$writer->save($path . "/test1.xlsx");
|
|
|
return false;
|
|
|
break;
|
|
|
+ case '4':
|
|
|
+ $path = dirname(dirname(dirname(__FILE__)));
|
|
|
+ $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($path . "/test.xlsx");
|
|
|
+ $sheet = $spreadsheet->getSheet(0);
|
|
|
+ $datas = $sheet->toArray();
|
|
|
+ $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
|
|
+ $dataapi = new DataApi();
|
|
|
+ for ($index = 0; $index < count($datas); $index++) {
|
|
|
+ echo "正在查询第" . ($index + 1) . "人({$datas[$index][1]})的失信被执行情况\r\n";
|
|
|
+ $res = $dataapi->untrustworthyPersonnel($datas[$index][2]);
|
|
|
+ echo "第". ($index + 1) . "人查询,姓名:{$datas[$index][1]},查询结果:{$res['message']}\r\n";
|
|
|
+ $sheet->setCellValue('D' . ($index+1), $res['message']);
|
|
|
+ }
|
|
|
+ $writer->save($path . "/test.xlsx");
|
|
|
+ return false;
|
|
|
+ break;
|
|
|
default:
|
|
|
return false;
|
|
|
|