Browse Source

更改描述

sandm 1 year ago
parent
commit
7c09ad289d

+ 41 - 0
app/admin/api/DataApi.php

@@ -88,6 +88,24 @@ class DataApi{
         }
     }
 
+    public function IDNumber($realname,$birthday){
+        $client = $this->getClient("http://110.88.153.177:802/ConvergenceServiceBoot/webservice/InsuranceRecordSearchs?wsdl");
+        $param = [
+            'guid' => $this->guid,
+            'requestid' => 'null_00001',
+            'aac003' => $realname,
+            'bac504' => $birthday
+        ];
+
+        $rst = $client->IDNumber($param);
+        $ret = json_decode($rst->return, true);
+        if($ret['code'] == '01'){
+            return $ret;
+        }else{
+            return false;
+        }
+    }
+
     public function queryOldAgeSecurityInsuranceByIdAndTime($card,$start,$end){
         $client = $this->getClient("http://110.88.153.177:802/ConvergenceServiceBoot/webservice/InsuranceRecordSearch?wsdl");
         $param = [
@@ -131,4 +149,27 @@ class DataApi{
             return false;
         }
     }
+
+    public function untrustworthyPersonnel($card){
+        $client = $this->getClient("http://110.88.153.177:802/ConvergenceServiceBoot/webservice/CityBrain?wsdl");
+        $param = [
+            'guid' => $this->guid,
+            'requestid' => 'null_00001',
+            'reason' => "测试",
+            'optIDCard' => "350582199006028550",
+            'optName' => "郑明炜",
+            'optIp' => get_client_ip(),
+            'optMac' => "00-D8-61-73-14-EC",
+            'IDCard' => $card
+        ];
+
+        $rst = $client->untrustworthyPersonnel($param);
+        $ret = json_decode($rst->return, true);
+        $ret = json_decode($ret, true);
+        if($ret['code'] == '200'){
+            return $ret;
+        }else{
+            return false;
+        }
+    }
 }

+ 58 - 0
app/admin/controller/DataCheck.php

@@ -0,0 +1,58 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\common\AdminController;
+use think\facade\Db;
+
+class DataCheck extends AdminController{
+
+    public function index(){
+        return view("", []);
+    }
+
+    /**
+     * 数据核验列表
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function list(){
+        $list = Db::table("new_data_check")->order('createTime','desc')->select();
+        return ["total" => count($list), "rows" => $list];
+    }
+
+    public function import_wuxian(){
+        $response_obj = new \StdClass();
+        if (!$this->request->file()){
+            $response_obj->code = 500;
+            $response_obj->msg = '没有选择文件';
+            return \StrUtil::back($response_obj, "DataCheck.callBack");
+        }
+
+        $excel = $this->request->file("file");
+
+        $year = $this->request->post('year');
+
+        $savename = \think\facade\Filesystem::disk("public")->putFile("uploadexcel", $excel);
+
+        $check_data = [
+            'task_name' => date("Y-m-d",time()) . "-导入五险({$year}年度)查询数据",
+            'task_file' => $savename,
+            'task_status' => -1,
+            'createTime' => date("Y-m-d H:i:s",time()),
+            'updateTime' => date("Y-m-d H:i:s",time())
+        ];
+
+        $id = Db::table("new_data_check")->insertGetId($check_data);
+
+        queue("app\job\Import", ["id" => $id,"type" => 1, 'year' => $year]);
+
+        $response_obj = new \StdClass();
+        $response_obj->code = 200;
+        $response_obj->msg = '导入成功';
+        return \StrUtil::back($response_obj, "DataCheck.callBack");
+    }
+
+}

+ 4 - 0
app/admin/controller/DirectlyIdentify.php

@@ -12,6 +12,10 @@ class DirectlyIdentify extends AdminController{
         return view("", []);
     }
 
+    public function index_wj(){
+        return view("", []);
+    }
+
     public function list(){
 
         $list = Db::table("new_talent_zhiren")->where('type',$this->user["type"])->order('createTime','desc')->select();

+ 1 - 1
app/admin/view/batch/add.html

@@ -68,7 +68,7 @@
                                     {eq name="source" value="1"}<option value="1">晋江市现代产业体系人才</option>{/eq}
                                     {eq name="source" value="2"}<option value="2">晋江市集成电路优秀人才</option>{/eq}
                                     {eq name="source" value="5"}<option value="5">卫健医院优秀人才</option>{/eq}
-                                    {eq name="source" value="6"}<option value="6">高教学校优秀人才</option>{/eq}
+                                    {eq name="source" value="6"}<option value="6">高等教育人才</option>{/eq}
                                 </select><i style="display: none;" class="form-control-feedback" data-bv-icon-for="source"></i>
                                 <small style="display: none;" class="help-block" data-bv-validator="notEmpty" data-bv-for="source" data-bv-result="NOT_VALIDATED">人才类型不能为空</small></div>
                         </div>

+ 123 - 0
app/admin/view/data_check/index.html

@@ -0,0 +1,123 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>核验数据管理</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+
+                        </div>
+                        <div class="hidden-xs" id="DictTableToolbar" role="group">
+                            {if condition="chkCommission('/admin/data_check/wuxian_template','/data_check/wuxian_template')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DataCheck.download_wuxian_template()">
+                                <i class="fa fa-plus"></i>&nbsp;五险查询模板下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/data_check/yibao_template','/data_check/yibao_template')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DataCheck.download_yibao_template()">
+                                <i class="fa fa-plus"></i>&nbsp;医保查询模板下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/data_check/import_wuxian','/data_check/import_wuxian')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DataCheck.import_wuxian()">
+                                <i class="fa fa-plus"></i>&nbsp;导入五险查询
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/qz_import_talent','/directly_identify/qz_import_talent')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DataCheck.qz_talent_import()">
+                                <i class="fa fa-plus"></i>&nbsp;导入泉州人才数据
+                            </button>
+                            {/if}
+                        </div>
+                        <table id="dataCheckTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                            <thead>
+                            <tr>
+                                <th data-field="selectItem" data-checkbox="true"></th>
+                            </tr>
+                            </thead>
+                        </table>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="modal fade " id="wuxianImportModal" tabindex="-1" role="dialog" >
+    <div class="modal-dialog" role="document">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" id="importModalLabel">五险查询数据导入</h4>
+            </div>
+            <div class="modal-body">
+                <form id="wuxian-import-form" action="/admin/data_check/import_wuxian" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                    <input type="file" id="file" name="file" onchange="$('#fileName').val($('#file').val());" class="hidden">
+                    <div class="form-group row">
+                        <div class="col-sm-2">查询年度</div>
+                        <div class="col-sm-10">
+                            <div class="input-group">
+                                <input type="text" class="form-control date" id="year" name="year" value=""/>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="form-group row">
+                        <div class="col-sm-2">查询文件</div>
+                        <div class="col-sm-10">
+                            <div class="input-group">
+                                <input type="text" class="form-control" id="fileName" name="fileName" placeholder="请选择需要上传的附件" readonly="readonly" >
+                                <span class="input-group-btn">
+                                    <button class="btn btn-secondary" type="button" onclick="$('#file').click()"><i class="fa fa-search"></i>选择文件</button>
+                                </span>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="DataCheck.wuxianImportSubmit()">提交</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<div class="modal fade " id="talentImportModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" >人才数据导入</h4>
+            </div>
+            <div class="modal-body">
+                <form id="talent-import-form" action="/admin/directly_identify/talent_import" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                    <input type="hidden" name="type" value="" id="import_type"/>
+                    <input type="file" id="file1" name="file" onchange="$('#fileName1').val($('#file1').val());" class="hidden">
+                    <div class="form-group row">
+                        <div class="col-sm-1"></div>
+                        <div class="col-sm-11">
+                            <div class="input-group">
+                                <input type="text" class="form-control" id="fileName1" name="fileName" placeholder="请选择需要上传的附件" readonly="readonly" >
+                                <span class="input-group-btn">
+                                    <button class="btn btn-secondary" type="button" onclick="$('#file1').click()"><i class="fa fa-search"></i>选择文件</button>
+                                </span>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="DataCheck.talentImportSubmit()">提交</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+<script src="/static/modular/dataCheck/index.js"></script>
+
+{/block}

+ 118 - 0
app/admin/view/directly_identify/index_wj.html

@@ -0,0 +1,118 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>直认数据管理</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+
+                        </div>
+                        <div class="hidden-xs" id="DictTableToolbar" role="group">
+
+                            {if condition="chkCommission('/admin/directly_identify/fj_talent_template','/directly_identify/fj_talent_template')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DirectlyIdentify.download_fj_talent_template()">
+                                <i class="fa fa-plus"></i>&nbsp;省上人才导入模板下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/qz_talent_template','/directly_identify/qz_talent_template')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DirectlyIdentify.download_qz_talent_template()">
+                                <i class="fa fa-plus"></i>&nbsp;泉州人才导入模板下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/fj_import_talent','/directly_identify/fj_import_talent')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DirectlyIdentify.fj_talent_import()">
+                                <i class="fa fa-plus"></i>&nbsp;导入省级人才数据
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/qz_import_talent','/directly_identify/qz_import_talent')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DirectlyIdentify.qz_talent_import()">
+                                <i class="fa fa-plus"></i>&nbsp;导入泉州人才数据
+                            </button>
+                            {/if}
+                        </div>
+                        <table id="directlyIdentifyTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                            <thead>
+                            <tr>
+                                <th data-field="selectItem" data-checkbox="true"></th>
+                            </tr>
+                            </thead>
+                        </table>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<!--核查征信导入模态框-->
+<div class="modal fade " id="enterpriseImportModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" id="importModalLabel">机构数据导入</h4>
+            </div>
+            <div class="modal-body">
+                <form id="enterprise-import-form" action="/admin/directly_identify/enterprise_import" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                    <input type="file" id="file" name="file" onchange="$('#fileName').val($('#file').val());" class="hidden">
+                    <div class="form-group row">
+                        <div class="col-sm-1"></div>
+                        <div class="col-sm-11">
+                            <div class="input-group">
+                                <input type="text" class="form-control" id="fileName" name="fileName" placeholder="请选择需要上传的附件" readonly="readonly" >
+                                <span class="input-group-btn">
+                                    <button class="btn btn-secondary" type="button" onclick="$('#file').click()"><i class="fa fa-search"></i>选择文件</button>
+                                </span>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="DirectlyIdentify.enterpriseImportSubmit()">提交</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<div class="modal fade " id="talentImportModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" >人才数据导入</h4>
+            </div>
+            <div class="modal-body">
+                <form id="talent-import-form" action="/admin/directly_identify/talent_import" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                    <input type="hidden" name="type" value="" id="import_type"/>
+                    <input type="file" id="file1" name="file" onchange="$('#fileName1').val($('#file1').val());" class="hidden">
+                    <div class="form-group row">
+                        <div class="col-sm-1"></div>
+                        <div class="col-sm-11">
+                            <div class="input-group">
+                                <input type="text" class="form-control" id="fileName1" name="fileName" placeholder="请选择需要上传的附件" readonly="readonly" >
+                                <span class="input-group-btn">
+                                    <button class="btn btn-secondary" type="button" onclick="$('#file1').click()"><i class="fa fa-search"></i>选择文件</button>
+                                </span>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="DirectlyIdentify.talentImportSubmit()">提交</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+<script src="/static/modular/directlyIdentify/index.js"></script>
+<script>
+    console.log(DirectlyIdentify)
+</script>
+{/block}

+ 140 - 0
app/job/Data.php

@@ -0,0 +1,140 @@
+<?php
+namespace app\job;
+
+use app\common\api\BatchApi;
+use app\common\api\TalentLogApi;
+use app\common\model\TalentChecklog;
+use app\common\state\ProjectState;
+use think\queue\Job;
+use think\facade\Log;
+use think\facade\Db;
+use app\common\api\ChuanglanSmsApi;
+// 给类文件的命名空间起个别名
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+//Xlsx类  保存文件功能类
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+use app\admin\api\DataApi;
+
+class Data {
+
+    public function fire(Job $job, $data) {
+        if ($this->deal($data)) {
+            Log::info(json_encode($data));
+            $job->delete();
+            return true;
+        }
+        Log::error(json_encode($data));
+        if ($job->attempts() >= 3) {
+            $job->delete();
+            return false;
+        }
+        $job->release(10); //10秒后重试
+    }
+
+    public function deal($data): bool {
+        $id = $data['id'];
+        $res = Db::table("new_data_check")->where('id', $id)->findOrEmpty();
+        switch ($data['type']){
+            case '1':
+                if ($res) {
+                    if ($res['task_status'] != -1) {
+                        return true;
+                    }
+                    try {
+                        $path = dirname(dirname(dirname(__FILE__)));
+                        $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($path ."/public/storage/" . $res['task_file']);
+                        $sheet = $spreadsheet->getSheet(0);
+                        $datas = $sheet->toArray();
+                        $datas = array_slice($datas, 1); //去标题
+                        $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
+                        $dataapi = new DataApi();
+                        for ($index = 0; $index <= count($datas); $index++) {
+                            $cards_list = [];
+                            if(empty($datas[$index][2])){//如果文件没有提供出生日期,查询系统内的出生日期
+                                echo "正在查询第" . ($index + 1) . "人({$datas[$index][0]})的出生日期\r\n";
+                                $info = Db::table('new_talent_info')->where("name ", "=", $datas[$index][0])->where('card_number', '=', $datas[$index][1])->find();
+                                if($info){
+                                    $birthday = $info['birthday'];
+                                }else{
+                                    $birthday = false;
+                                }
+                            }else{
+                                $birthday = $datas[$index][2];
+                            }
+                            if($birthday){
+                                echo "正在查询第" . ($index + 1) . "人({$datas[$index][0]}----{$birthday})的证件号\r\n";
+                                $cards = $dataapi->IDNumber($datas[$index][0],date("Ymd",strtotime($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][1]);
+                            array_push($cards_list,substr($datas[$index][1],4));//到底里把所有能取到证件号的渠道得到的证件号放一起
+                            $cards_list = array_unique($cards_list);//去掉重复的证件号码
+                            $shixian = [];
+                            $yanglao = [];//定义失业险和养老险数据
+                            foreach ($cards_list as $v){
+                                if(count($shixian) == 0){
+                                    echo "正在查询第" . ($index + 1) . "人({$datas[$index][0]}----{$v})的失业险\r\n";
+                                    $start = $data['year'] . "01";
+                                    $end = $data['year'] + 1 . "01";
+                                    $res = $dataapi->queryUnemploymentInsuranceByIdAndTime($v,"{$start}","{$end}");
+                                    Db::table('data_check_log')->save(['realname' => $datas[$index][0],'card' => $v,'params' => json_encode(['card' => $v,'start' => $start,'end' => $end]), '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;
+                                        }
+                                    }
+                                }
+
+
+
+
+
+                                echo "第". ($index + 1) . "失业险整理完毕,姓名:{$datas[$index][1]},2022年共缴费0个月\r\n";
+                                $sheet->setCellValue('F' . ($index+1), "2022年共缴费0个月");
+                                sleep(3);
+                            }
+
+
+
+
+
+
+
+
+                        }
+
+
+
+
+                    } catch (\Exception $e) {
+                        var_dump($e->getMessage());
+                        Db::table("new_data_check")->where('id', $id)->update(['task_result' => $e->getMessage(), 'task_status' => 0, 'updateTime' => date("Y-m-d H:i:s", time())]);
+                        return false;
+                    }
+                }
+                $path = dirname(dirname(dirname(__FILE__)));
+                $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($path . "/test.xlsx");
+                $sheet = $spreadsheet->getSheet(0);
+                $datas = $sheet->toArray();
+
+
+                break;
+        }
+    }
+}

+ 85 - 35
app/job/Jjhc.php

@@ -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;
 

+ 98 - 0
public/static/modular/dataCheck/index.js

@@ -0,0 +1,98 @@
+/**
+ * 表格初始化
+ */
+var DataCheck = {
+    id: "dataCheckTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+DataCheck.initColumn = function () {
+    return [
+        {field: 'selectItem', radio: true},
+        {title: 'ID', field: 'id', visible: true, align: 'center', valign: 'middle'},
+        {title: '任务名称', field: 'task_name', visible: true, align: 'center', valign: 'middle'},
+        {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
+        {title: '任务结果', field: 'task_status', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index) {
+                if (value == 0) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-danger btn-xs\">处理失败</button>";
+                }
+                if (value == 1) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">处理成功</button>";
+                }
+                if (value == -1) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">处理中</button>";
+                }
+            }
+        },
+        {title: '结果文件', field: 'task_result', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index){
+                if(value != ''){
+                    return "<a href='/storage/" + value+"' style=\"line-height: 1.3\">下载导入结果</a>";
+                }
+            }
+        },
+        {title: '完成时间', field: 'updateTime', visible: true, align: 'center', valign: 'middle'},
+    ];
+};
+
+//模板下载
+DataCheck.download_wuxian_template = function () {
+    window.location.href = Feng.ctxPath + "/static/downloadFile/data_check_wuxian_template.xlsx";
+}
+
+DataCheck.download_yibao_template = function () {
+    window.location.href = Feng.ctxPath + "/static/downloadFile/data_check_yibao_template.xlsx";
+}
+
+DataCheck.import_wuxian = function () {
+    $("#wuxian-import-form")[0].reset();
+    $("#wuxianImportModal").modal("show");
+}
+
+DataCheck.wuxianImportSubmit = function () {
+    $("#wuxian-import-form")[0].submit();
+}
+
+
+//回调
+DataCheck.callBack = function (data) {
+    Feng.info(data.msg);
+    if (data.code == 200) {
+        $("#wuxianImportModal").modal("hide");
+        $("#talentImportModal").modal("hide");
+        DataCheck.table.refresh();
+    }
+}
+
+
+$(function () {
+
+    var defaultColunms = DataCheck.initColumn();
+    var table = new BSTable(DataCheck.id, "/admin/data_check/list", defaultColunms);
+    table.setPaginationType("server");
+    DataCheck.table = table.init();
+    //下拉框数据动态加载
+    Feng.addAjaxSelect({
+        "id": "talentLevel",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": "/admin/dict/findChildDictByCode?code=talent_arrange"
+    });
+
+    //批量加载时间控件
+    $(".date").each(function () {
+        laydate.render({
+            elem: this
+            , type: 'year'
+            , trigger: 'click'
+        });
+    });
+
+});