Explorar o código

测试社保(养老)

sandm %!s(int64=2) %!d(string=hai) anos
pai
achega
33335a528a

+ 73 - 0
app/admin/controller/Talent.php

@@ -38,6 +38,45 @@ class Talent extends AdminController {
         $info = VerifyApi::getTalentInfoById($id, true);
         $force = intval($this->request['force'], 0);
         $api_data = ApiData::where('uid', '=', $info['card_number'])->where('action', '=', 'rending')->where('status', '=', 1)->find(); //
+//        $api_test = [
+//            'code' => 200,
+//            'data' => [
+//                'list' => [
+//                    [
+//                        "aae022" => 150.8,
+//                        "aae020" => 301.6,
+//                        "aae003" => 201911,
+//                        "aab034" => "晋江市社会劳动保险中心",
+//                        "aae002" => 201912,
+//                        "aab004" => "福建省晋江人力资本有限公司",
+//                        "aaa115" => "正常应缴",
+//                        "aae180" => 1885,
+//                    ],
+//                    [
+//                        "aae022" => 150.8,
+//                        "aae020" => 301.6,
+//                        "aae003" => 201912,
+//                        "aab034" => "晋江市社会劳动保险中心",
+//                        "aae002" => 201912,
+//                        "aab004" => "福建省晋江人力资本有限公司",
+//                        "aaa115" => "正常应缴",
+//                        "aae180" => 1885,
+//                    ]
+//                ],
+//                'totalCount' => 70
+//            ]
+//        ];
+//        $tmp_time = explode(' - ',$info['tax_insurance_month']);
+//        $formatDate = formatDateByMonth($tmp_time[0],$tmp_time[1],$api_test['data']['list']);
+//        $str = '';
+//        foreach ($formatDate as $item){
+//            $str .= $item . "<br />";
+//        }
+//        $info['shenbao'] =  "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$api_test['data']['totalCount']}个月数据,分别为:<br />$str";
+
+
+
+        //dd($tmp_time,diffDate($tmp_time[0],$tmp_time[1]));
         if ($force || !$api_data || !$api_data['status']) {
             ApiData::where('uid', '=', $info['card_number'])->where('action', '=', 'rending')->where('status', '=', 1)->update(['status' => 0, 'updateTime' => time()]);
             $rsapi = new RsApi();
@@ -45,6 +84,22 @@ class Talent extends AdminController {
                 $content = [];
                 $info['rs']['I010902'] = $content['I010902'] = $rsapi->I010902($info['card_number']);
                 $info['rs']['I030101'] = $content['I030101'] = $rsapi->I030101($info['card_number']);
+                $tmp_time = explode(' - ',$info['tax_insurance_month']);
+                $content['YL00018'] = $rsapi->YL00018($info['card_number'],str_replace('-','',$tmp_time[0]),str_replace('-','',$tmp_time[1]));
+                $formatDate = formatDateByMonth($tmp_time[0],$tmp_time[1],$content['YL00018']['data']['list']);
+                $str = '';
+                foreach ($formatDate as $tmp_item){
+                    $str .= $tmp_item . "<br />";
+                }
+                if(count($formatDate) == $content['YL00018']['data']['totalCount']){
+                    $content['YL00018']['status'] = 'success';
+                }else{
+                    $content['YL00018']['status'] = 'warning';
+                }
+                $content['YL00018']['content'] = "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$content['YL00018']['data']['totalCount']}个月数据,分别为:<br />$str";
+
+                unset($tmp_time);
+                unset($tmp_item);
                 $api_model_data = [
                     'uid' => $info['card_number'],
                     'action' => 'rending',
@@ -55,6 +110,24 @@ class Talent extends AdminController {
             }
         } else {
             $content = unserialize($api_data['content']);
+            if(array_key_exists('YL00018',$content)){
+                $tmp_time = explode(' - ',$info['tax_insurance_month']);
+                $formatDate = formatDateByMonth($tmp_time[0],$tmp_time[1],$content['YL00018']['data']['list']);
+                $str = '';
+                foreach ($formatDate as $tmp_item){
+                    $str .= $tmp_item . "<br />";
+                }
+                if(count($formatDate) == $content['YL00018']['data']['totalCount']){
+                    $content['YL00018']['status'] = 'success';
+                }else{
+                    $content['YL00018']['status'] = 'warning';
+                }
+                $content['YL00018']['content'] = "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$content['YL00018']['data']['totalCount']}个月数据,分别为:<br />$str";
+                unset($tmp_time);
+                unset($tmp_item);
+            }else{
+                $content['YL00018'] = [];
+            }
             $info['rs'] = $content;
         }
         $info["process"] = $process;

+ 18 - 1
app/admin/view/talent/talentInfo_common_check.html

@@ -321,7 +321,24 @@
                                         <tr>
                                             <td>
                                                 <div class="rowGroup ">
-                                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>{if condition="$info['talent_type'] eq 2"}首次{/if}在我市缴交社会保险或个人所得税月份</label>
+                                                    <label class=" control-label spacing td-label">
+                                                        <span style="color: red">*</span>{if condition="$info['talent_type'] eq 2"}首次{/if}在我市缴交社会保险或个人所得税月份
+                                                        {switch name="info.rs.YL00018.code"}
+                                                            {case value="403"}<i class="fa fa-times" style="color: red" data-msg="{$info.rs.YL00018.message}"></i>{/case}
+                                                            {case value="200"}
+                                                                {eq name="info.rs.YL00018.status" value="success"}
+                                                                <i class="fa fa-check" style="color: green" data-id="shebao"></i>
+                                                                {else /}
+                                                                <i class="fa fa-exclamation" style="color: #e6a23c" data-id="shebao"></i>
+                                                                {/eq}
+                                                            {/case}
+                                                            {default /}<i class="fa fa-exclamation" style="color: #e6a23c" data-msg="接口返回消息:{$info.rs.I010902.message},请自行审核"></i>
+                                                        {/switch}
+
+                                                        <div id="shebao"  style="display: none">
+                                                            {$info.rs.YL00018.content|raw}
+                                                        </div>
+                                                    </label>
                                                     <input type="text" class="form-control" value="{$info.tax_insurance_month}" id="tax_insurance_month"/>
                                                 </div>
                                             </td>

+ 3 - 3
app/command/Solver.php

@@ -26,16 +26,16 @@ class Solver extends Command {
 
     protected function execute(Input $input, Output $output) {
         // 指令输出
-        $lockFileName = "/data/wwwroot/rencai.jucai.gov.cn/task_solver.lock";
+        $lockFileName = "task_solver.lock";
         $lockFile = fopen($lockFileName, "a");
         if (flock($lockFile, LOCK_EX | LOCK_NB)) {//文件锁(独占)
             set_time_limit(0);
             $root = app()->getRootPath();
             $schedules = Db::table("new_schedule")->select();
             foreach ($schedules as $schedule) {
-                //检查时间到了没                
+                //检查时间到了没
                 if (XwCrontab::check(time(), $schedule["timeStr"]) && $schedule["state"] == 1) {
-                    exec("/usr/local/php/bin/php {$root}think " . $schedule["action"]);
+                    exec("php {$root}think " . $schedule["action"]);
                 }
             }
             flock($lockFile, LOCK_UN);

+ 45 - 0
app/common.php

@@ -487,3 +487,48 @@ function mystr_unpad($data){
     $n = ord(substr($data,-1));
     return substr($data, 0, -$n);
 }
+
+//计算两个日期的时间差
+function diffDate($date1,$date2){
+    if (strtotime($date1) > strtotime($date2)) {
+        $ymd = $date2;
+        $date2 = $date1;
+        $date1 = $ymd;
+    }
+    $date1 = date('Y-m-d',strtotime($date1));
+    $date2 = date('Y-m-d',strtotime($date2));
+    list($y1, $m1, $d1) = explode('-', $date1);
+    list($y2, $m2, $d2) = explode('-', $date2);
+    $y = $m = $d = $_m = 0;
+    $math = ($y2 - $y1) * 12 + $m2 - $m1;
+    $y = intval(floor($math / 12));
+    $m = intval($math % 12);
+    $d = (mktime(0, 0, 0, $m2, $d2, $y2) - mktime(0, 0, 0, $m2, $d1, $y2)) / 86400;
+    if ($d < 0) {
+        $m -= 1;
+        $d += date('j', mktime(0, 0, 0, $m2, 0, $y2));
+    }
+    return array($y, $m, $d);
+}
+
+function formatDateByMonth($date1,$date2,$data = []){
+    if (strtotime($date1) > strtotime($date2)) {
+        $ymd = $date2;
+        $date2 = $date1;
+        $date1 = $ymd;
+    }
+    $sTime = strtotime(date('Y-m-01', strtotime($date1)));
+    $eTime = strtotime(date('Y-m-01', strtotime($date2)));
+    $month_arr = [];
+    for($sTime; $sTime <= $eTime;  $sTime = strtotime('+1 month', $sTime)){
+        $month_arr[date('Ym',$sTime)] = date('Y-m',$sTime); // 取得递增月;
+    }
+    if(count($data) > 0){
+        foreach ($data as $item) {
+            if(array_key_exists($item['aae003'],$month_arr)){
+                $month_arr[$item['aae003']] .= "<span style='color:green'>已缴费</span>";
+            }
+        }
+    }
+    return $month_arr;
+}

+ 8 - 1
public/static/modular/talentIdentify/talentInfo/talentInfo_common_check.js

@@ -843,7 +843,14 @@ $(function () {
 
     $(".fa").bind("mouseover", function () {
         var htm = $(this).data('msg');
-        $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
+        console.log(htm)
+        if(htm != '' && typeof(htm) != "undefined"){
+            $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
+        }else{
+            var id = $(this).data('id');
+            html = $("#"+id).html();
+            $(this).webuiPopover({title: '详情', content: html, trigger: 'hover',placement: 'right'}).webuiPopover('show');
+        }
     });
 
     /*var source = $("#source").val();