Kaynağa Gözat

津补贴中查看合同附件增加判断,按时间先后,如果有工作变更或者基础信息变更(合同时间有变更),则显示最新的变更附件

sugangqiang 7 ay önce
ebeveyn
işleme
eaaed56a71

+ 36 - 6
app/common/controller/Api.php

@@ -620,9 +620,9 @@ class Api extends BaseController {
             case "application/zip":
             case "application/x-rar-compressed":
             case "application/x-7z-compressed":
-                if(!in_array($file->extension(),['zip','7z','rar'])){
+                if (!in_array($file->extension(), ['zip', '7z', 'rar'])) {
                     $filestd = $upload->uploadOne($file, "file", "talent_files");
-                }else{
+                } else {
                     if (in_array($type, [ProjectState::JBT])) {
                         $filestd = $upload->uploadOne($file, "hybrid", "talent_files");
                     } else {
@@ -639,7 +639,7 @@ class Api extends BaseController {
                 exit();
                 break;
         }
-        if($filestd->code != 200){
+        if ($filestd->code != 200) {
             $res = ["msg" => $filestd->msg, "obj" => $index];
             echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
             exit();
@@ -1241,9 +1241,39 @@ class Api extends BaseController {
     }
 
     public function findContractFileType() {
+        $talentId = $this->request["talentId"];
+        $talentInfo = \app\common\api\VerifyApi::getTalentInfoById($talentId);
+        $project = ProjectState::TALENT;
+        //检查是否有工作单位变更记录
+        $_where = [];
+        $_where[] = ["checkState", "=", 3];
+        $_where[] = ["delete", "=", 0];
+        $_where[] = ["idCard", "=", $talentInfo["card_number"]];
+        $workChange = Db::table("un_talent_workunit_change")->where($_where)->order("passTime desc")->find();
+
+        //检查是否有基础信息变更记录并且有合同变更
+        $_where = [];
+        $_where[] = ["checkState", "=", 3];
+        $_where[] = ["delete", "=", 0];
+        $_where[] = ["newIdCard", "=", $talentInfo["card_number"]];
+        $_string = "oldContractTime <> '' and oldContractTime <> concat(newContractStartTime,' - ',newContractEndTime)";
+        $baseChange = Db::table("un_talent_basic_change")->where($_where)->where($_string)->order("newSubmitTime desc")->find();
+
+        if ($workChange && !$baseChange) {
+            $project = ProjectState::WORKCHANGE;
+        }
+        if (!$workChange && $baseChange) {
+            $project = ProjectState::BASICCHANGE;
+        }
+        if ($workChange && $baseChange) {
+            $project = strtotime($workChange["passTime"]) > strtotime($baseChange["newSubmitTime"]) ? ProjectState::WORKCHANGE : ProjectState::BASICCHANGE;
+        }
+
         $type = $this->request["type"];
-        $where[] = ["name", "like", "%工作%"];
-        $where[] = ["project", "=", 1];
+        if ($project == ProjectState::TALENT) {
+            $where[] = ["name", "like", "%工作%"];
+        }
+        $where[] = ["project", "=", $project];
         $where[] = ["active", "=", 1];
         $where[] = ["isConditionFile", "<>", 1];
         $where[] = ["delete", "=", 0];
@@ -1260,7 +1290,7 @@ class Api extends BaseController {
         return view("", ["id" => $talentInfo["id"], "type" => $type]);
     }
 
-    public function filePreview(){
+    public function filePreview() {
         $url = $this->request["url"];
         $title = $this->request["title"];
         return view("", ["url" => $url, "title" => $title]);

+ 1 - 0
app/common/view/api/contract_view.html

@@ -70,6 +70,7 @@
         initFileTable();
         function initFileTable() {
             var queryData = {};
+            queryData['talentId'] = $("#id").val();
             queryData['type'] = $("#type").val();
             $("#fileTable").bootstrapTable({
                 url: Feng.ctxPath + "/common/api/findContractFileType",

+ 1 - 2
app/common/view/layout/content.html

@@ -7,8 +7,7 @@
     <meta http-equiv="Pragma" content="no-cache">
     <meta http-equiv="Cache-Control" content="no-cache">
     <meta http-equiv="Expires" CONTENT="0">
-    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
-    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
+    <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
     <!-- 全局css -->
     <link rel="shortcut icon" href="/static/favicon.ico">
     <link href="/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">

+ 4 - 4
app/enterprise/controller/Talent.php

@@ -1854,7 +1854,7 @@ class Talent extends EnterpriseController {
         $year = $this->request["year"];
         $type = $this->request["type"];
         $res = [];
-        $ids = null;
+        $idCards = null;
         $year = substr($year, 0, 4);
         //根据申报年度查询当前企业已申报的人才
         if ($type == 1) {  //津补贴
@@ -1863,20 +1863,20 @@ class Talent extends EnterpriseController {
             $where[] = ["delete", "=", 0];
             $where[] = ["enterpriseId", "=", $this->user["uid"]];
             $talentAllowances = \app\common\model\TalentAllowance::where($where)->select()->toArray();
-            $ids = array_unique(array_column($talentAllowances, "talentId"));
+            $idCards = array_unique(array_column($talentAllowances, "idCard"));
         } else if ($type == 2) {    //购房补贴
             $where = [];
             $where[] = ["year", "like", $year . "%"];
             $where[] = ["delete", "=", 0];
             $where[] = ["enterpriseId", "=", $this->user["uid"]];
             $housePurchases = \app\common\model\HousePurchase::where($where)->select()->toArray();
-            $ids = array_unique(array_column($housePurchases, "talentId"));
+            $idCards = array_unique(array_column($housePurchases, "idCard"));
         }
         $whr = [];
         $whr[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
         $whr[] = ["ti.enterprise_id", "=", $this->user["uid"]];
         $whr[] = ["e.type", "=", $this->user["type"]];
-        $whr[] = ["ti.id", "not in", $ids];
+        $whr[] = ["ti.card_number", "not in", $idCards];
         $twiceIdentifyPersons = \app\common\api\VerifyApi::getTwiceIdentifyPersons();
         if ($twiceIdentifyPersons) {
             $_whr = $whr;