sugangqiang 1 سال پیش
والد
کامیت
66e23cf203

+ 7 - 2
app/admin/controller/IntegralVerify.php

@@ -18,6 +18,7 @@ use app\common\state\ProjectState;
 use app\common\state\IntegralState;
 use app\common\model\IntegralRecord;
 use app\common\model\IntegralDetail;
+use app\common\state\CommonConst;
 
 /**
  * Description of Talent
@@ -343,7 +344,7 @@ class IntegralVerify extends AdminController {
      */
     public function publicExport() {
         $params = $this->request->param();
-        $columns = ["序号", "批次", "姓名", "证件类型", "证件号码", "工作单位", "申请积分项目", "拟认定获得积分", "审核状态", "备注"];
+        $columns = ["序号", "批次", "姓名", "证件类型", "证件号码", "工作单位", "申请积分项目", "当前总积分", "当前人才层次", "增加后的总积分", "增加积分后的层次", "审核状态", "备注"];
         $startTime = $params["startTime"];
         $endTime = $params["endTime"];
         if (!strtotime($startTime) || !strtotime($endTime))
@@ -366,8 +367,12 @@ class IntegralVerify extends AdminController {
                 $tmp_items[] = sprintf("%s(%s%s)+%d积分", $integral_item_info["name"], $_item["amount"], $integral_item_info["unit"], $_item["point"]);
                 $total_points += $_item["point"];
             }
+            $where = [];
+            $where[] = ["card_type", "=", $item["card_type"]];
+            $where[] = ["card_number", "=", $item["card_number"]];
+            $log = Db::table("new_integral_log")->where($where)->order("createTime desc")->find();
             $row = [
-                $i, $item["apply_year"], $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], implode(";", $tmp_items), $total_points, $item["checkState"] == IntegralState::ANNOUNCED ? "审核通过" : "审核不通过", $item["description"]
+                $i, $item["apply_year"], $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], implode(";", $tmp_items), $log["nowPoints"], CommonConst::getLayerNameByLayer($log["talentLevel"]), $log["nowPoints"] + $total_points, CommonConst::getLayerNameByLayer(CommonConst::getLayerByPoints($log["nowPoints"] + $total_points)), $item["checkState"] == IntegralState::ANNOUNCED ? "审核通过" : "审核不通过", $item["description"]
             ];
             $rows[] = $row;
             $i++;

+ 35 - 0
app/admin/controller/System.php

@@ -120,4 +120,39 @@ class System extends AdminController {
         echo "加入队列成功";
     }
 
+    /**
+     * 导入电路人才条款
+     */
+    public function import_old_ic_conditions() {
+        $where = [];
+        $where[] = ["type", "=", 2];
+        $oldConditions = Db::table("un_identify_condition")->where($where)->select()->toArray();
+        foreach ($oldConditions as $oldCondition) {
+            queue("app\job\Worker", ["type" => 98, "id" => $oldCondition["id"]]);
+        }
+    }
+
+    /**
+     * 设置电路条款与旧版一致启用状态
+     */
+    public function set_ic_condition_active() {
+        $where = [];
+        $where[] = ["type", "=", 2];
+        $upd["active"] = 2;
+        Db::table("new_talent_condition")->where($where)->update($upd);
+
+        $where = [];
+        $where[] = ["type", "=", 2];
+        $where[] = ["active", "=", 1];
+        $oldActiveConditions = Db::table("un_identify_condition")->where($where)->select()->toArray();
+        $oldActiveConditioinNames = array_column($oldActiveConditions, "name");
+
+
+        $where = [];
+        $where[] = ["type", "=", 2];
+        $where[] = ["name", "in", $oldActiveConditioinNames];
+        $upd["active"] = 1;
+        Db::table("new_talent_condition")->where($where)->update($upd);
+    }
+
 }

+ 2 - 0
app/admin/view/integral_verify/detail.html

@@ -65,6 +65,7 @@
     .has-feedback label~.form-control-feedback{
         top: 31px;
     }
+    .tips{color:#ff0000;font-size:18px;line-height:20px;}
 </style>
 <div class="ibox float-e-margins">
     <div class="ibox-content">
@@ -85,6 +86,7 @@
                                 <div class="panel panel-default">
                                     <div class="panel-heading" onclick="$(this).next().toggle()">基础信息</div>
                                     <div class="panel-body">
+                                        <div class="tips" id="tips">{$row.tips}</div>
                                         <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
                                             <tr>
                                                 <td>

+ 43 - 0
app/common/api/IntegralRecordApi.php

@@ -23,6 +23,7 @@ class IntegralRecordApi {
         $result["enterprise"]["streetName"] = DictApi::findDictByCode($result["enterprise"]["street"])["name"];
         if ($result) {
             $result["items"] = $result->detail;
+            $result["tips"] = self::getIntegralRecordByIdCard($result["card_type"], $result["card_number"]);
         }
         return $result;
     }
@@ -574,6 +575,48 @@ class IntegralRecordApi {
         return $returnObj;
     }
 
+    /**
+     *  获取是否在库及积分情况
+     * @param type $cardType
+     * @param type $cardNumber
+     * @return array $response
+     */
+    public static function getIntegralRecordByIdCard($cardType, $cardNumber) {
+        $where = [];
+        $where[] = ["card_type", "=", $cardType];
+        $where[] = ["card_number", "=", $cardNumber];
+        $where[] = ["checkState", "=", TalentState::CERTIFICATED];
+        $talentInfo = Db::table("new_talent_info")->where($where)->find();
+
+        $where = [];
+        $where[] = ["card_type", "=", $cardType];
+        $where[] = ["card_number", "=", $cardNumber];
+        $integralLog = Db::table("new_integral_log")->where($where)->order("createTime desc")->find();
+        if (session("user")["usertype"] == 2 && (($talentInfo && session("user")["uid"] != $talentInfo["enterprise_id"]) || ($integralLog && session("user")["uid"] != $integralLog["enterprise_id"]))) {
+            $response = [
+                "deny" => 1
+            ];
+        } else {
+            $response = [
+                "isTalentInLibrary" => $talentInfo ? 1 : 0,
+                "levelName" => CommonConst::getLayerNameByLayer($integralLog["talentLevel"]),
+                "level" => $integralLog["talentLevel"],
+                "totalPoints" => $integralLog["nowPoints"] ?: 0
+            ];
+        }
+
+        if ($response["deny"]) {
+            //不是本企业人员
+            return "该身份证已经在别的企业申报过优秀人才 / 积分项目";
+        } else if ($response["isTalentInLibrary"] == 1 || $response["totalPoints"] > 0) {
+            //在库人才
+            $levelTypeName = $response["level"] >= 1 && $response["level"] <= 7 ? "在库人才(" . $response["levelName"] . ")" : $response["levelName"];
+            return sprintf("该人员为%s,截至目前,已累计%d积分", $levelTypeName, $response["totalPoints"]);
+        } else {
+            return "";
+        }
+    }
+
     public static function setPublic($mainId, $state, $msg, $batch = null) {
         $data["id"] = $mainId;
         $data["checkState"] = $state;

+ 4 - 25
app/common/controller/Api.php

@@ -850,31 +850,10 @@ class Api extends BaseController {
     }
 
     function getIntegralRecordByIdCard() {
-        $card_type = $this->request->param("cardType");
-        $card_number = $this->request->param("cardNumber");
-        $where = [];
-        $where[] = ["card_type", "=", $card_type];
-        $where[] = ["card_number", "=", $card_number];
-        $where[] = ["checkState", "=", TalentState::CERTIFICATED];
-        $talentInfo = Db::table("new_talent_info")->where($where)->find();
-
-        $where = [];
-        $where[] = ["card_type", "=", $card_type];
-        $where[] = ["card_number", "=", $card_number];
-        $integralLog = Db::table("new_integral_log")->where($where)->order("createTime desc")->find();
-        if (session("user")["usertype"] == 2 && (($talentInfo && session("user")["uid"] != $talentInfo["enterprise_id"]) || ($integralLog && session("user")["uid"] != $integralLog["enterprise_id"]))) {
-            $response = [
-                "deny" => 1
-            ];
-        } else {
-            $response = [
-                "isTalentInLibrary" => $talentInfo ? 1 : 0,
-                "levelName" => \app\common\state\CommonConst::getLayerNameByLayer($integralLog["talentLevel"]),
-                "level" => $integralLog["talentLevel"],
-                "totalPoints" => $integralLog["nowPoints"] ?: 0
-            ];
-        }
-        return json($response);
+        $cardType = $this->request->param("cardType");
+        $cardNumber = $this->request->param("cardNumber");
+        $tips = \app\common\api\IntegralRecordApi::getIntegralRecordByIdCard($cardType, $cardNumber);
+        return json(["tips" => $tips]);
     }
 
     function getIntegralProjectsByType() {

+ 16 - 0
app/common/state/CommonConst.php

@@ -53,4 +53,20 @@ class CommonConst {
         return $levelAndNames[$level];
     }
 
+    /**
+     * 通过积分得到层次
+     * @param type $points
+     * @return int
+     */
+    public static function getLayerByPoints($points) {
+        $level = 1;
+        while ($levelPoints = CommonConst::getLayerPointsByLayer($level)) {
+            if ($points >= $levelPoints) {
+                break;
+            }
+            $level++;
+        }
+        return $level;
+    }
+
 }

+ 2 - 1
app/enterprise/view/integral/apply.html

@@ -65,6 +65,7 @@
     .has-feedback label~.form-control-feedback{
         top: 31px;
     }
+    .tips{color:#ff0000;font-size:18px;line-height:20px;}
 </style>
 <div class="ibox float-e-margins">
     <div class="ibox-content">
@@ -86,7 +87,7 @@
                                 <div class="panel panel-default">
                                     <div class="panel-heading" onclick="$(this).next().toggle()">基础信息</div>
                                     <div class="panel-body">
-                                        <div class="form-control" id="tips"></div>
+                                        <div class="tips" id="tips">{$row.tips}</div>
                                         <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
                                             <tr>
                                                 <td>

+ 2 - 0
app/enterprise/view/integral/view.html

@@ -65,6 +65,7 @@
     .has-feedback label~.form-control-feedback{
         top: 31px;
     }
+    .tips{color:#ff0000;font-size:18px;line-height:20px;}
 </style>
 <div class="ibox float-e-margins">
     <div class="ibox-content">
@@ -85,6 +86,7 @@
                                 <div class="panel panel-default">
                                     <div class="panel-heading" onclick="$(this).next().toggle()">基础信息</div>
                                     <div class="panel-body">
+                                        <div class="tips" id="tips">{$row.tips}</div>
                                         <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
                                             <tr>
                                                 <td>

+ 5 - 0
app/job/Worker.php

@@ -37,6 +37,11 @@ class Worker {
     public function deal($data): bool {
         $type = $data["type"];
         switch ($type) {
+            case 98:
+                //转移旧集成电路的认定条款到新表
+                $oldConditionId = $data["id"];
+                return $this->getIdentifyCondition($oldConditionId);
+                break;
             case 99://转移旧集成电路人才申报信息到新库
                 $talent_info = $data["talent_info"];
                 return $this->oldJcjlTalentInfoToNewTable($talent_info);

+ 2 - 11
public/static/modular/gate/integral/integralInfo.js

@@ -380,18 +380,9 @@ IntegralInfoDlg.calIntegral = function (obj) {
 IntegralInfoDlg.multipleRefreshPoints = function () {
     if ($("#card_type").val() > 0 && $("#card_number").val() != "") {
         var ajax = new $ax(Feng.ctxPath + "/common/api/getIntegralRecordByIdCard", function (data) {
-            if (data.deny) {
-                //不是本企业人员
-                $("#tips").html("该身份证已经在别的企业申报过积分项目")
-            } else if (data.isTalentInLibrary == 1 || data.totalPoints > 0) {
-                //在库人才
-                let levelTypeName = data.level >= 1 && data.level <= 7 ? "在库人才(" + data.levelName + ")" : data.levelName;
-                $("#tips").html("该人员为" + levelTypeName + ",截至目前,已累计" + data.totalPoints + "积分")
-            } else {
-                $("#tips").html("");
-            }
+            $("#tips").html(data.tips);
         }, function (data) {
-            Feng.error("预估积分失败!" + data.responseJSON.message + "!");
+            Feng.error("获取个人相关信息失败!");
         });
         ajax.set("cardType", $("#card_type").val());
         ajax.set("cardNumber", $("#card_number").val());

+ 6 - 5
public/static/modular/talentIdentify/integralMgr/IntegralLog.js

@@ -74,10 +74,11 @@ IntegralVerify.initColumn = function () {
             }
         },
         {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
-        {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
-        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
+        {title: '积分获得时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
+        {title: '操作', field: 'mainId', visible: true, align: 'center', valign: 'middle', width: "80px",
             formatter: function (value, row, index) {
-                return "<span class='label label-success' onclick=\"IntegralVerify.showLog('" + value + "')\" >" +
+                var type = row.mainType == "integral" ? CONFIG.project_integral_apply : CONFIG.project_rcrd;
+                return "<span class='label label-success' onclick=\"IntegralVerify.showLog('" + value + "'," + "'" + type + "')\" >" +
                         "<i class=\"fa fa-book\"></i>日志" +
                         "</span>";
             }
@@ -185,7 +186,7 @@ IntegralVerify.openCheckIntegralVerify = function () {
 /**
  * 显示审核日志
  */
-IntegralVerify.showLog = function (id) {
+IntegralVerify.showLog = function (id, type) {
     layer.open({
         type: 1,
         title: "日志",
@@ -194,7 +195,7 @@ IntegralVerify.showLog = function (id) {
         area: ['80%', '80%'],
         maxmin: true,
         success: function (layero, index) {
-            Feng.getCheckLog(id, {"type": CONFIG.project_integral_apply, "mainId": id, "typeFileId": "", "active": 1})
+            Feng.getCheckLog(id, {"type": type, "mainId": id, "typeFileId": "", "active": 1})
         }
     });
 }