Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

sandm před 2 roky
rodič
revize
fa90285155

+ 18 - 2
app/admin/controller/Talent.php

@@ -1144,7 +1144,8 @@ class Talent extends AdminController {
             $companys = VerifyApi::getNewReCheckCompanyIds($re_check_companys, $companys, $pass_companyIds);
             $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"], $talent_info["first_dept_check_time"]); //重审单位中已经通过的单位
         }
-
+        $no_valid_companyIds = array_diff($pass_companyIds, $companys);
+        $pass_companyIds = array_diff($pass_companyIds, $no_valid_companyIds);
         $over = $pass_companyIds ? count($pass_companyIds) : 0; //完成度,如果重审之前已有通过审核的部门,不用再审,直接按通过算
         $error = 0; //失败数
         $nowProcess = 4;
@@ -1155,7 +1156,7 @@ class Talent extends AdminController {
         }
         $logs = TalentLogApi::getListLogByTime($talent_info["id"], $talent_info["first_dept_check_time"]);
         for ($i = 0; $i < count($logs); $i++) {
-            if (!in_array($logs[$i]["companyId"], $pass_companyIds)) {
+            if (!in_array($logs[$i]["companyId"], $pass_companyIds) && in_array($logs[$i]["companyId"], $companys)) {
                 $over += $logs[$i]["active"] == 1 ? 1 : 0;
                 if ($logs[$i]["new_state"] == TalentState::SCND_SUBMIT) {
                     $error++;
@@ -1169,6 +1170,21 @@ class Talent extends AdminController {
             if ($error == 0) {
                 $log_checkState = $checkState = TalentState::DEPT_VERIFY_PASS;
                 $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
+                $data["modify_files"] = null;
+            }
+            if ($log_checkState == TalentState::DEPT_VERIFY_REJECT) {
+                $talent_condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
+                $cwfts = explode(";", $talent_condition["companyWithFileType"]);
+                $fileTypes = [];
+                foreach ($cwfts as $cwft) {
+                    $_company_setting = explode(":", $cwft);
+                    $_fileTypes = explode(",", $_company_setting[1]);
+                    $fileTypes = array_merge($fileTypes, $_fileTypes);
+                }
+                $modify_files = explode(",", $talent_info["modify_files"]);
+                $removeFileTypes = array_diff($modify_files, $fileTypes);
+                $newModifyFiles = array_diff($modify_files, $removeFileTypes);
+                $data["modify_files"] = implode(",", $newModifyFiles);
             }
             $data["id"] = $talent_info["id"];
             $data["checkState"] = $checkState;

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

@@ -66,7 +66,7 @@
                             <div class="col-sm-9">
                                 <select class="form-control" selectVal="{$source}" id="source" name="source" data-bv-field="source" onchange="">
                                     {eq name="source" value="1"}<option value="1">晋江市现代产业体系人才</option>{/eq}
-                                    {eq name="source" value="12"}<option value="2">晋江市集成电路优秀人才</option>{/eq}
+                                    {eq name="source" value="2"}<option value="2">晋江市集成电路优秀人才</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>

+ 5 - 1
app/common/controller/Api.php

@@ -97,6 +97,8 @@ class Api extends BaseController {
         $list = [];
         switch ($type) {
             case 1:
+                $talentInfo = TalentApi::getOne($mainId);
+                $talent_condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
             case 20:
                 $list = TalentLogApi::getList($type, $mainId);
                 break;
@@ -227,6 +229,9 @@ class Api extends BaseController {
                             } else {
                                 $new_item["stateName"] = '<span class="label label-success">待审核</span>';
                             }
+                            if ($item["active"] === 0 && !in_array($item["companyId"], explode(",", $talent_condition["companyIds"]))) {
+                                $new_item["stateName"] = '<span class="label">已废弃</span>';
+                            }
                         } else {
                             $new_item["stateName"] = '<span class="label label-primary">审核通过</span>';
                         }
@@ -276,7 +281,6 @@ class Api extends BaseController {
             $new_list[] = $new_item;
         }
         if ($type == ProjectState::TALENT) {
-            $talentInfo = TalentApi::getOne($mainId);
             if ($talentInfo["oldId"]) {
                 $where = [];
                 $where[] = ["mainId", "=", $talentInfo["oldId"]];

+ 76 - 2
app/job/Worker.php

@@ -53,8 +53,56 @@ class Worker {
         $whr = [];
         $whr[] = ["card_type", "=", $talent_info["cardType"]];
         $whr[] = ["card_number", "=", $talent_info["idCard"]];
+        $whr[] = ["apply_year", "=", $talent_info["year"]];
         $whr[] = ["checkState", ">=", 0];
-        if (Db::table("new_talent_info")->where($whr)->find()) {
+        if ($ti = Db::table("new_talent_info")->where($whr)->find()) {
+            $where = [];
+            $where[] = ["mainId", "=", $ti["id"]];
+            $where[] = ["type", "=", \app\common\state\ProjectState::TALENT];
+            $log = Db::table("new_talent_checklog")->where($where)->find();
+            if (!$log) {
+                $log["last_state"] = $log["new_state"] = $log["state"] = $ti["checkState"];
+                $log["id"] = getStringId();
+                $log["type"] = \app\common\state\ProjectState::TALENT;
+                $log["mainId"] = $ti["id"];
+                $log["active"] = 1;
+                $log["description"] = "旧系统导入新系统自动生成";
+                $log["createUser"] = "系统";
+                $log["createTime"] = date("Y-m-d H:i:s");
+                \app\common\model\TalentLog::create($log);
+                return true;
+            }
+            if (!$ti["talent_condition"]) {
+                $oldTi = Db::table("un_talent_info")->where("id", $ti["oldId"])->find();
+                $oldCondition = Db::table("un_identify_condition")->where("id", $oldTi["identifyCondition"])->find();
+                $where = [];
+                $where[] = ["name", "=", $oldCondition["name"]];
+                $where[] = ["type", "=", 2];
+                $newCondition = Db::table("new_talent_condition")->where($where)->find();
+                $newConditionId = $newCondition["id"];
+                if (!$newCondition) {
+                    $condition["source"] = $oldCondition["source"];
+                    $condition["talentLevel"] = $oldCondition["talentLevel"];
+                    $condition["type"] = $oldCondition["type"];
+                    $condition["name"] = $oldCondition["name"];
+                    $condition["activeYear"] = $oldCondition["activeYear"];
+                    $condition["notWorkYear"] = $oldCondition["notWorkYear"];
+                    $condition["active"] = $oldCondition["active"];
+                    $condition["companyIds"] = $oldCondition["companyIds"];
+                    $condition["description"] = $oldCondition["description"];
+                    $condition["createTime"] = $oldCondition["createTime"];
+                    $condition["createUser"] = $oldCondition["createUser"];
+                    $condition["updateTime"] = $oldCondition["updateTime"];
+                    $condition["updateUser"] = $oldCondition["updateUser"];
+                    $newConditionId = Db::table("new_talent_condition")->insertGetId($condition);
+                }
+                if ($newConditionId) {
+                    $updData["id"] = $ti["id"];
+                    $updData["talent_condition"] = $newConditionId;
+                    Db::table("new_talent_info")->save($updData);
+                }
+                return true;
+            }
             return false;
         }
 
@@ -199,8 +247,17 @@ class Worker {
                     $updData["modify_files"] = implode(",", array_filter(array_unique($tmp)));
                 }
                 $updData["id"] = $newTalentInfoId;
-                Db::table("un_talent_info")->save($updData);
+                Db::table("new_talent_info")->save($updData);
             }
+            $log["last_state"] = $log["new_state"] = $log["state"] = $data["checkState"];
+            $log["id"] = getStringId();
+            $log["type"] = \app\common\state\ProjectState::TALENT;
+            $log["mainId"] = $newTalentInfoId;
+            $log["active"] = 1;
+            $log["description"] = "旧系统导入新系统自动生成";
+            $log["createUser"] = "系统";
+            $log["createTime"] = date("Y-m-d H:i:s");
+            \app\common\model\TalentLog::create($log);
             return true;
         }
         return false;
@@ -253,6 +310,23 @@ class Worker {
         $where[] = ["name", "=", $oldCondition["name"]];
         $where[] = ["type", "=", 2];
         $newCondition = Db::table("new_talent_condition")->where($where)->find();
+        if (!$newCondition) {
+            $condition["source"] = $oldCondition["source"];
+            $condition["talentLevel"] = $oldCondition["talentLevel"];
+            $condition["type"] = $oldCondition["type"];
+            $condition["name"] = $oldCondition["name"];
+            $condition["activeYear"] = $oldCondition["activeYear"];
+            $condition["notWorkYear"] = $oldCondition["notWorkYear"];
+            $condition["active"] = $oldCondition["active"];
+            $condition["companyIds"] = $oldCondition["companyIds"];
+            $condition["description"] = $oldCondition["description"];
+            $condition["createTime"] = $oldCondition["createTime"];
+            $condition["createUser"] = $oldCondition["createUser"];
+            $condition["updateTime"] = $oldCondition["updateTime"];
+            $condition["updateUser"] = $oldCondition["updateUser"];
+            $newConditionId = Db::table("new_talent_condition")->insertGetId($condition);
+            return $newConditionId;
+        }
         return $newCondition["id"];
     }