Преглед изворни кода

人社局加密接口对接

sandm пре 2 година
родитељ
комит
38252a6e6d

+ 32 - 0
app/admin/api/RsApi.php

@@ -105,4 +105,36 @@ class RsApi {
         return json_decode($res,true);
 
     }
+
+    /**
+     * 根据身份证号码查询个人婚姻信息
+     * @param $card
+     * @return array|mixed
+     */
+    public function I030101($card){
+        $check_res = $this->check();
+        if(!$check_res) return ['code' => '403','message' => '测试环境'];
+        $param = [
+            'aac002' => $card,
+            'sjhjLog' => $this->sjhjLog
+        ];
+
+        $res = $this->getInfo('I030101',$param);
+
+        return json_decode($res,true);
+    }
+
+    public function I110202($card,$time){
+        $check_res = $this->check();
+        if(!$check_res) return ['code' => '403','message' => '测试环境'];
+        $param = [
+            'zjhm' => $card,
+            'ny' => $time,
+            'sjhjLog' => $this->sjhjLog
+        ];
+
+        $res = $this->getInfo('I110202',$param);
+
+        return json_decode($res,true);
+    }
 }

+ 25 - 5
app/admin/controller/Talent.php

@@ -7,6 +7,7 @@ use app\common\api\ChuanglanSmsApi;
 use app\common\api\VerifyApi;
 use app\common\api\TalentLogApi;
 use app\common\api\TalentState;
+use app\common\controller\Api;
 use app\common\model\MessageRecord;
 use app\enterprise\model\Talent as TalentModel;
 use app\common\api\TalentConditionApi;
@@ -20,6 +21,7 @@ use app\admin\model\SysRelation;
 use app\common\api\CompanyApi;
 use app\common\state\ProjectState;
 use app\admin\api\RsApi;
+use app\admin\model\ApiData;
 
 /**
  * Description of Talent
@@ -33,11 +35,29 @@ class Talent extends AdminController {
         $params = $request->param();
         $id = $params["id"];
         $info = VerifyApi::getTalentInfoById($id, true);
-        $rsapi = new RsApi();
-        if($info['card_type'] == 1){
-            $info['rs']['I010902'] = $rsapi->I010902($info['card_number']);
-
-        }
+//        $rsapi = new RsApi();
+//        if($info['card_type'] == 1){
+//            $endTime = strtotime(date('Y-m-d').'23:59:59');
+//            $api_data = ApiData::where('uid','=',$info['card_number'])->where('action', '=', 'rending')->where('createTime','<',$endTime)->find();//当天没有记录就请求
+//            if(!$api_data){
+//                $content = [];
+//                $info['rs']['I010902'] = $content['I010902'] = $rsapi->I010902($info['card_number']);
+//                $info['rs']['I030101'] = $content['I030101'] = $rsapi->I030101($info['card_number']);
+//                $api_model_data = [
+//                    'uid' => $info['card_number'],
+//                    'action' => 'rending',
+//                    'content' => serialize($content),
+//                    'createTime' => time()
+//                ];
+//
+//                ApiData::create($api_model_data);
+//            }else{
+//                $content = unserialize($api_data['content']);
+//            }
+//
+//
+//
+//        }
         if (in_array($info["checkState"], [TalentState::BASE_VERIFY_FAIL, TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS, TalentState::BASE_REVERIFY_REJECT, TalentState::BASE_REVERIFY_FAIL])) {
             return view("talentInfo_base_check", ["info" => $info]);
         } else {

+ 17 - 0
app/admin/model/ApiData.php

@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * Description of SysRelation
+ *
+ * @author sgq
+ */
+
+namespace app\admin\model;
+
+use think\Model;
+
+class ApiData extends Model {
+
+    protected $table = "sys_api_data";
+
+}

+ 11 - 11
app/admin/view/talent/talentInfo_common_check.html

@@ -98,17 +98,17 @@
                                                     <div class="rowGroup">
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>
                                                             姓名
-                                                            {switch name="info.rs.I010902.code"}
-                                                                {case value="403"}<i class="fa fa-times" style="color: red" data-msg="{$info.rs.I010902.message}"></i>{/case}
-                                                                {case value="200"}
-                                                                    {eq name="info.rs.I010902.data.list.0.NAME" value="$info.name"}
-                                                                    <i class="fa fa-check" data-msg="信息正确"></i>
-                                                                    {else /}
-                                                                    <i class="fa fa-times" style="color: red" data-msg="填写姓名与人社数据有误,接口返回姓名'{$info.rs.I010902.data.list.0.NAME}'"></i>
-                                                                    {/eq}
-                                                                {/case}
-                                                                {default /}{$info.rs.I010902.message}
-                                                            {/switch}
+<!--                                                            {switch name="info.rs.I010902.code"}-->
+<!--                                                                {case value="403"}<i class="fa fa-times" style="color: red" data-msg="{$info.rs.I010902.message}"></i>{/case}-->
+<!--                                                                {case value="200"}-->
+<!--                                                                    {eq name="info.rs.I010902.data.list.0.NAME" value="$info.name"}-->
+<!--                                                                    <i class="fa fa-check" data-msg="该用户填写姓名与公安数据一致,信息正确"></i>-->
+<!--                                                                    {else /}-->
+<!--                                                                    <i class="fa fa-times" style="color: red" data-msg="填写姓名与公安数据不一不致,接口返回姓名'{$info.rs.I010902.data.list.0.NAME}'"></i>-->
+<!--                                                                    {/eq}-->
+<!--                                                                {/case}-->
+<!--                                                                {default /}<i class="fa fa-exclamation" data-msg="公安数据接口返回消息:{$info.rs.I010902.message},请自行审核"></i>-->
+<!--                                                            {/switch}-->
                                                             </label>
                                                         <input type="text" class="form-control" id="name" value="{$info.name}"/>
                                                     </div>