| 
					
				 | 
			
			
				@@ -17,6 +17,7 @@ use app\common\api\IntegralRecordApi; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use app\common\state\ProjectState; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use app\common\state\IntegralState; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use app\common\model\IntegralRecord; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+use app\common\model\IntegralDetail; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * Description of Talent 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -88,7 +89,7 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 预备人才库 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function pre_list() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (session("user")["type"] == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($this->user["type"] == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $message = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 "typeName" => "晋江市现代产业体系人才积分评定", "address" => "聚才网/人才晋江微信公众号", "dep" => "中共晋江市委人才办、晋江市纪委监委驻市人力资源和社会保障局纪检监察组或晋江市公共就业和人才服务中心", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 "phone" => "0595-85633128", "email" => "jjrc85661234@163.com" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -118,11 +119,11 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $res = ["code" => 500, "msg" => "没有选择导出的名单"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $where[] = ["ti.id", "in", $ids_arr]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $list = TalentModel::alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")->field("ti.name,ti.card_type,ti.card_number,e.name as enterpriseName,e.description")->where($where)->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $where[] = ["ir.id", "in", $ids_arr]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $list = IntegralRecord::alias("ir")->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->field("ir.name,ir.card_type,ir.card_number,e.name as enterpriseName,e.description")->where($where)->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $res = ["code" => 500, "msg" => "没有可以导出的内容"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            echo sprintf("<script>IntegralInfo.callBack(%s);</script>", json_encode($res)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $columns = ["序号", "姓名", "证件类型", "证件号码", "工作单位", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $rows = []; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -135,7 +136,7 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $rows[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $filename = "现代产业体系人才核查征信名单导出"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $filename = "积分申报核查征信名单导出"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($rows) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             export($columns, $rows, $filename); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exit(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -152,18 +153,18 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = array_filter(explode(",", $ids)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $msg = "征信通过"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $state = TalentState::ZX_PASS; //征信通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $state = IntegralState::ZX_PASS; //征信通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $total = count($ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $error = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $success = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($ids as $id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($talent_info["checkState"] != TalentState::REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($record["checkState"] != IntegralState::REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (VerifyApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (IntegralRecordApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $success++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -182,12 +183,12 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$msg) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "请填写审核意见"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $msg = "征信失信:" . $msg; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $state = TalentState::ZX_FAIL; //征信不通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if ($talent_info["checkState"] != TalentState::REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $state = IntegralState::ZX_FAIL; //征信不通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($record["checkState"] != IntegralState::REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "当前记录不是待核查征信状态,无法核查"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (VerifyApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (IntegralRecordApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["code" => 200, "msg" => "已设置征信失信"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return json(["msg" => "设置征信失信失败"]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -199,26 +200,34 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function publicExportBefore() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $params = $this->request->param(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids_arr = array_filter(explode(",", $params["ids"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $columns = ["序号", "批次", "姓名", "证件类型", "证件号码", "工作单位", "申请积分项目", "拟认定获得积分", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($ids_arr) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $where[] = ["id", "in", $ids_arr]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $list = TalentModel::where($where)->order("talent_arrange asc,enterprise_id asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $where[] = ["ir.id", "in", $ids_arr]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $list = IntegralRecord::alias("ir")->where($where) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->leftJoin("sys_batch b", "b.id=ir.batch_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->field("ir.*,e.name as enterpriseName,b.batch as apply_year,tl.state as real_state,tl.last_state,tl.description")->order("createTime asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $rows = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $i = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talentArranges = DictApi::selectByParentCode("talent_arrange"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $card_types = DictApi::selectByParentCode("card_type"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             foreach ($list as $item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $talent_condition = TalentConditionApi::getOne($item["talent_condition"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $enterprise = EnterpriseApi::getOne($item["enterprise_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $checkLog = TalentLogApi::getLastLog($item["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $tmp_items = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $total_points = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                foreach ($item["detail"] as $_item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $tmp_items[] = sprintf("%s(%s%s)+%d积分", $integral_item_info["name"], $_item["amount"], $integral_item_info["unit"], $_item["point"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $total_points += $_item["point"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $row = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == TalentState::ZX_PASS ? "审核通过" : "审核不通过", $checkLog["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $i, $item["apply_year"], $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], implode(";", $tmp_items), $total_points, $item["checkState"] == IntegralState::ZX_PASS ? "审核通过" : "审核不通过", $item["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $rows[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($rows) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $filename = "现代产业体系人才公示预览导出"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $filename = "积分申报公示预览导出"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             export($columns, $rows, $filename); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -230,29 +239,37 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function publicExport() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $params = $this->request->param(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $columns = ["序号", "批次", "姓名", "证件类型", "证件号码", "工作单位", "申请积分项目", "拟认定获得积分", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $startTime = $params["startTime"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $endTime = $params["endTime"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!strtotime($startTime) || !strtotime($endTime)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "时间格式错误"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $where[] = ["checkState", "=", TalentState::ANNOUNCED]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $where[] = ["ir.checkState", "=", IntegralState::ANNOUNCED]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where[] = ["publicBatch", "between", [$startTime, $endTime]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $list = TalentModel::where($where)->order("talent_arrange asc,enterprise_id asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $list = IntegralRecord::alias("ir")->where($where) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->leftJoin("sys_batch b", "b.id=ir.batch_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->field("ir.*,e.name as enterpriseName,b.batch as apply_year,tl.state as real_state,tl.last_state,tl.description")->order("createTime asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $rows = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $i = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $talentArranges = DictApi::selectByParentCode("talent_arrange"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $card_types = DictApi::selectByParentCode("card_type"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($list as $item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_condition = TalentConditionApi::getOne($item["talent_condition"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $enterprise = EnterpriseApi::getOne($item["enterprise_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $checkLog = TalentLogApi::getLastLog($item["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $tmp_items = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $total_points = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            foreach ($item["detail"] as $_item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $tmp_items[] = sprintf("%s(%s%s)+%d积分", $integral_item_info["name"], $_item["amount"], $integral_item_info["unit"], $_item["point"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $total_points += $_item["point"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $row = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == TalentState::ANNOUNCED ? "审核通过" : "审核不通过", $checkLog["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $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"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $rows[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($rows) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $filename = "现代产业体系人才公示导出"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $filename = "积分申报公示导出"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             export($columns, $rows, $filename); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -278,22 +295,21 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = array_filter(explode(",", $ids)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $msg = "已公示"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $state = TalentState::ANNOUNCED; //公示 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $state = IntegralState::ANNOUNCED; //公示 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $total = count($ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $error = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $success = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $phones = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($ids as $id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($talent_info["checkState"] != TalentState::ZX_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($record["checkState"] != IntegralState::ZX_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (VerifyApi::setPublic($id, $state, $msg, $publicBatch)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (IntegralRecordApi::setPublic($id, $state, $msg, $publicBatch)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $success++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $ep = EnterpriseApi::getOne($talent_info['enterprise_id']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $phones[] = $ep->agentPhone; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $phones[] = $record["enterprise"]->agentPhone; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -312,7 +328,7 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $record_data = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'id' => $recordId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    'bizId' => $recordId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    'bizId' => $result["msgId"], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'type' => 2, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'smsType' => 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'phone' => $phone, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -342,16 +358,16 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "请填写审核意见"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($checkState == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $msg = "公示再审核通过:" . $msg; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $state = TalentState::ANNOUNCED_REVERIFY_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $state = IntegralState::ANNOUNCED_REVERIFY_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $msg = "公示再审核不通过:" . $msg; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $state = TalentState::ANNOUNCED_REVERIFY_FAIL; //公示再审核不通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $state = IntegralState::ANNOUNCED_REVERIFY_FAIL; //公示再审核不通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if ($talent_info["checkState"] != TalentState::ANNOUNCED) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($record["checkState"] != IntegralState::ANNOUNCED) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "当前记录不是公示状态,无法审核"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (VerifyApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (IntegralRecordApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["code" => 200, "msg" => "公示再审核完成"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return json(["msg" => "公示再审核失败"]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -365,18 +381,18 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = $params["ids"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = array_filter(explode(",", $ids)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $msg = "公示再审核批量通过"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $state = TalentState::ANNOUNCED_REVERIFY_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $state = IntegralState::ANNOUNCED_REVERIFY_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $total = count($ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $error = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $success = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($ids as $id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($talent_info["checkState"] != TalentState::ANNOUNCED) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($record["checkState"] != IntegralState::ANNOUNCED) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (VerifyApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (IntegralRecordApi::setPublic($id, $state, $msg)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $success++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -393,24 +409,33 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = $params["ids"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = array_filter(explode(",", $ids)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($ids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $where[] = ["id", "in", $ids]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $list = TalentModel::where($where)->order("talent_arrange asc,enterprise_id asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $where[] = ["ir.id", "in", $ids]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $list = IntegralRecord::alias("ir")->where($where) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->leftJoin("sys_batch b", "b.id=ir.batch_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ->field("ir.*,e.name as enterpriseName,b.batch as apply_year,tl.state as real_state,tl.last_state,tl.description")->order("createTime asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $rows = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $i = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talentArranges = DictApi::selectByParentCode("talent_arrange"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $card_types = DictApi::selectByParentCode("card_type"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             foreach ($list as $item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $talent_condition = TalentConditionApi::getOne($item["talent_condition"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $enterprise = EnterpriseApi::getOne($item["enterprise_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $checkLog = TalentLogApi::getLastLog($item["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $tmp_items = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $total_points = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                foreach ($item["detail"] as $_item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $tmp_items[] = sprintf("%s(%s%s)+%d积分", $integral_item_info["name"], $_item["amount"], $integral_item_info["unit"], $_item["point"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $total_points += $_item["point"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $row = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == TalentState::ANNOUNCED_REVERIFY_PASS ? "审核通过" : "审核不通过", $checkLog["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $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_REVERIFY_PASS ? "审核通过" : "审核不通过", $item["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $rows[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "认定人才层次", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $filename = "现代产业体系人才" . date("Ym") . "公布预览名单导出(公示批次-" . $list[0]["publicBatch"] . ")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $columns = ["序号", "批次", "姓名", "证件类型", "证件号码", "工作单位", "申请积分项目", "拟认定获得积分", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $filename = "积分申报" . date("Ym") . "公布预览名单导出(公示批次-" . $list[0]["publicBatch"] . ")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($rows) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             export($columns, $rows, $filename); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exit(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -427,24 +452,34 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $endTime = $params["endTime"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!strtotime($startTime) || !strtotime($endTime)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "时间格式错误"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $where[] = ["checkState", "=", TalentState::PUBLISH_PASS]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $where[] = ["certificateGetTime", "between", [$startTime, $endTime]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $list = TalentModel::where($where)->order("talent_arrange asc,enterprise_id asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $where[] = ["ir.checkState", "=", IntegralState::PUBLISH_PASS]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $where[] = ["ir.getTime", "between", [$startTime, $endTime]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $list = IntegralRecord::alias("ir")->where($where) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->leftJoin("sys_batch b", "b.id=ir.batch_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where createTime in (select max(createTime) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ->field("ir.*,e.name as enterpriseName,b.batch as apply_year,tl.state as real_state,tl.last_state,tl.description")->order("createTime asc")->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $rows = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $i = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $talentArranges = DictApi::selectByParentCode("talent_arrange"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $card_types = DictApi::selectByParentCode("card_type"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($list as $item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_condition = TalentConditionApi::getOne($item["talent_condition"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $enterprise = EnterpriseApi::getOne($item["enterprise_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $checkLog = TalentLogApi::getLastLog($item["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $tmp_items = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $total_points = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            foreach ($item["detail"] as $_item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $integral_item_info = getCacheById("IntegralItem", $_item["item_id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $tmp_items[] = sprintf("%s(%s%s)+%d积分", $integral_item_info["name"], $_item["amount"], $integral_item_info["unit"], $_item["point"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $total_points += $_item["point"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $row = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == TalentState::PUBLISH_PASS ? "审核通过" : "审核不通过", $checkLog["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $i, $item["apply_year"], $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], implode(";", $tmp_items), $total_points, $item["checkState"] == IntegralState::PUBLISH_PASS ? "审核通过" : "审核不通过", $item["description"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $rows[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "认定人才层次", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $filename = "现代产业体系人才" . date("Ym") . "公布名单导出(公示批次-" . $list[0]["publicBatch"] . ")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $columns = ["序号", "批次", "姓名", "证件类型", "证件号码", "工作单位", "申请积分项目", "拟认定获得积分", "审核状态", "备注"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $filename = "积分申报" . date("Ym") . "公布名单导出(公示批次-" . $list[0]["publicBatch"] . ")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($rows) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             export($columns, $rows, $filename); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exit(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -462,25 +497,25 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $checkState = $params["checkState"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $batch = $params["batch"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($checkState == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $state = TalentState::PUBLISH_PASS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $state = IntegralState::PUBLISH_PASS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $msg = "公布审核通过:" . $msg; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $state = TalentState::PUBLISH_FAIL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $state = IntegralState::PUBLISH_FAIL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $msg = "公布审核不通过:" . $msg; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$batch || !strtotime($batch)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "公布批次时间错误"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$msg) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "请填写审核意见"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $state = TalentState::PUBLISH_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $state = IntegralState::PUBLISH_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $batch = $params["batch"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!strtotime($batch)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "公布批次时间错误"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if ($talent_info["checkState"] != TalentState::ANNOUNCED_REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($record["checkState"] != IntegralState::ANNOUNCED_REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "当前记录不是公示再审核通过状态,无法审核"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (VerifyApi::setPublic($id, $state, $msg, $batch)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (IntegralRecordApi::setPublic($id, $state, $msg, $batch)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["code" => 200, "msg" => "公布审核完成"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return json(["msg" => "公布审核失败"]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -494,7 +529,7 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = $params["ids"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $ids = array_filter(explode(",", $ids)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $msg = "批量公布"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $state = TalentState::PUBLISH_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $state = IntegralState::PUBLISH_PASS; //公示再审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $batch = $params["batch"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!strtotime($batch)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(["msg" => "公布批次时间错误"]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -502,12 +537,12 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $error = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $success = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($ids as $id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_info = VerifyApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($talent_info["checkState"] != TalentState::ANNOUNCED_REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($record["checkState"] != IntegralState::ANNOUNCED_REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (VerifyApi::setPublic($id, $state, $msg, $batch)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (IntegralRecordApi::setPublic($id, $state, $msg, $batch)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $success++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $error++; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -522,63 +557,46 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function prepareCertification() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $lockFile = fopen("send_certificate.lock", "a"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (flock($lockFile, LOCK_EX | LOCK_NB)) {//文件锁(独占) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//查询所有待发放人才码的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $params = $this->request->param(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $ids = array_filter(explode(",", $params["ids"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//晋江市优秀人才证书:当前年份+层次+四位递增数字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//集成电路优秀人才证书:IC+当前年份+递增四位数,如IC20190001 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Db::startTrans(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $talent_max_no = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $user = session("user"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $user = $this->user; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $talent_list = VerifyApi::getListByIds($ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $record_list = IntegralRecordApi::getListByIds($ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $year = date("Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                foreach ($talent_list as $talent_info) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if ($talent_info["checkState"] != TalentState::PUBLISH_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                foreach ($record_list as $record) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ($record["checkState"] != IntegralState::PUBLISH_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Db::rollback(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        return json(["msg" => "只能对公布通过的对象发放人才码,请核查待发放人才码名单后再重新发放人才码"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        return json(["msg" => "只能对公布通过的对象发放积分,请核查待发放积分名单后再重新发放积分"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $no_prefix = $year . $talent_info["talent_arrange"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $where[] = ["certificateNo", "like", $no_prefix . "%"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $max_no = $talent_max_no[$talent_info["talent_arrange"]] ?: Db::table("new_talent_info")->where($where)->max("certificateNo"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (!$max_no) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        $max_no = $no_prefix . "0001"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        $new_no = intval(substr($max_no, 5)) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        $max_no = $no_prefix . str_pad($new_no, 4, "0", STR_PAD_LEFT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//更新证书编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $data["id"] = $talent_info["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $data["certificateNo"] = $max_no; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $data["checkState"] = TalentState::CERTIFICATED; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $data["id"] = $record["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $data["checkState"] = IntegralState::SUCCESS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $data["isPublic"] = 5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Db::table("new_talent_info")->update($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Db::table("new_integral_record")->update($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //写入日志 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $log["last_state"] = TalentState::PUBLISH_PASS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $log["last_state"] = IntegralState::PUBLISH_PASS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $log["id"] = getStringId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $log["state"] = $log["new_state"] = TalentState::CERTIFICATED; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $log["type"] = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $log["mainId"] = $talent_info["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $log["state"] = $log["new_state"] = IntegralState::SUCCESS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $log["type"] = ProjectState::INTEGRAL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $log["mainId"] = $record["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $log["companyId"] = $user["companyId"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $log["active"] = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $log["description"] = "人才码为:" . $max_no; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $log["description"] = "积分申报成功"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $log["createUser"] = sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $log["createTime"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Db::table("new_talent_checklog")->insert($log); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $talent_max_no[$talent_info["talent_arrange"]] = $max_no; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Db::commit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return json(["code" => 200, "msg" => "发放人才码成功"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json(["code" => 200, "msg" => "发放积分成功"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } catch (\Exception $e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Db::rollback(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return json(["msg" => "发放人才码失败:" . $e->getMessage()]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json(["msg" => "发放积分失败:" . $e->getMessage()]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             flock($lockFile, LOCK_UN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return json(["msg" => "同一时间只能有一个管理员进行发放人才码操作"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json(["msg" => "同一时间只能有一个管理员进行发放积分操作"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -640,21 +658,25 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         IntegralRecord::update($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         TalentLogApi::setActive($log["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $userIds = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (in_array($data["checkState"], [IntegralState::VERIFY_PASS])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (in_array($log["state"], [IntegralState::VERIFY_PASS])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //初审成功需要发送短信给复核部门,复核的其它状态发送通知给用户,调用此方法的还有基础审核的每个状态都要发送通知给用户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //从复核权限,逆推复核人员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $privs = ["/admin/integralVerify/re_verify"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $menuIds = MenuApi::getMenuIdsByNewUrls($privs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $codes = ["integralVerify_reCheck"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $menuIds = MenuApi::getMenuIdsByCodes($codes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["menuid", "in", $menuIds]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($privs))->column("roleid"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($codes))->column("roleid"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["status", "=", 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $where[] = ["roleid", "in", $roleIds]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $where[] = ["type", "=", $this->user["type"]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["roleid", "<>", 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $userIds = User::where($where)->column("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $regstr = ",(" . implode("|", $roleIds) . "),"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $whereRaw = "concat(',',roleid,',') REGEXP '$regstr'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $userIds = User::where($where)->whereRaw($whereRaw)->column("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->sendMsgByState($record, $log["new_state"], $userIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->sendMsgByState($record, $log["state"], $userIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return json(["code" => 200, "msg" => "审核成功"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -668,9 +690,18 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $params = $request->param(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $data["modify_files"] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $data["modify_fields"] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $totalPoints = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($params["checkState"] == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //审核成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $log_checkState = $checkState = IntegralState::REVERIFY_PASS; //复核成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            foreach ($record->detail as $item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $result = IntegralRecordApi::calIntegral($record["enterprise_id"], $record["card_type"], $record["card_number"], $item["item_id"], $item["amount"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $totalPoints += $result->points; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $iData["id"] = $item["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $iData["point"] = $result->points; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                IntegralDetail::update($iData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $data["totalPoints"] = $totalPoints; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else if ($params["checkState"] == 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //审核驳回并记录需要修改的字段和上传文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $checkState = IntegralState::SUBMIT; //退回待初审 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -707,25 +738,31 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         IntegralRecord::update($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         TalentLogApi::setActive($log["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $userIds = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (in_array($data["checkState"], [IntegralState::REVERIFY_PASS, IntegralState::REVERIFY_REJECT])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (in_array($log["state"], [IntegralState::REVERIFY_PASS, IntegralState::REVERIFY_REJECT])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //复核成功需要发送短信给征信部门,复核的其它状态发送通知给用户,调用此方法的还有基础审核的每个状态都要发送通知给用户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //从征信审核权限,逆推征信部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if ($data["checkState"] == IntegralState::REVERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $privs = ["/admin/integralVerify/hczxReject", "/admin/integralVerify/hczxPass"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $codes = ["integralVerify_hczxReject", "integralVerify_firstCheck_hczxPass"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $privs = ["admin/integralVerify/fst_check"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $codes = ["integralVerify_firstCheck"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $menuIds = MenuApi::getMenuIdsByNewUrls($privs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $menuIds = MenuApi::getMenuIdsByCodes($codes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["menuid", "in", $menuIds]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($privs))->column("roleid"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($codes))->column("roleid"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["status", "=", 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $where[] = ["roleid", "in", $roleIds]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $where[] = ["type", "=", $this->user["type"]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["roleid", "<>", 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $userIds = User::where($where)->column("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $regstr = ",(" . implode("|", $roleIds) . "),"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $whereRaw = "concat(',',roleid,',') REGEXP '$regstr'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $userIds = User::where($where)->whereRaw($whereRaw)->column("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->sendMsgByState($record, $data["checkState"], $userIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->sendMsgByState($record, $log["state"], $userIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return json(["code" => 200, "msg" => "审核成功"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -739,32 +776,32 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         switch ($state) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case IntegralState::VERIFY_PASS://初审通过发送短信通知并审部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $type = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $processName = "初级审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $processName = "积分申报-初级审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $template = "【晋江市人才服务平台】您的部门有新的积分申报需要审批,请及时登录审批系统处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case IntegralState::VERIFY_REJECT; //初审驳回发送短信通知用户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $type = 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $processName = "初级审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $processName = "积分申报-初级审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $template = "【晋江市人才服务平台】尊敬的用户,您提交的积分申报审核驳回,原因是:{$log['description']},请及时登录申报系统修改并重新提交。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case IntegralState::VERIFY_FAIL://初审不通过发送短信通知用户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $type = 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $processName = "初级审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $processName = "积分申报-初级审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $template = "【晋江市人才服务平台】尊敬的用户,您提交的积分申报审核不通过,原因是:{$log['description']}。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case IntegralState::REVERIFY_PASS://复核通过发短信通知征信部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $type = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $processName = "复审"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $processName = "积分申报-复审"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $template = "【晋江市人才服务平台】有新的积分申报通过复审进入征信阶段,请及时登录审批系统处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case IntegralState::REVERIFY_REJECT://复核驳回发短信通知初审部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $type = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $processName = "复审"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $processName = "积分申报-复审"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $template = "【晋江市人才服务平台】有积分申报在复审阶段被驳回,原因是:{$log['description']},请及时登录审批系统处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case IntegralState::REVERIFY_FAIL://并审驳回发送短信通知初审部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $type = 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $processName = "复审"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $processName = "积分申报-复审"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $template = "【晋江市人才服务平台】尊敬的用户,您提交的积分申报审核不通过,原因是:{$log['description']}。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -789,7 +826,7 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $record_data = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'id' => $id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'userId' => $userId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    'bizId' => $id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    'bizId' => $result["msgId"], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'type' => $type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'smsType' => 2, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'name' => $name, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -880,7 +917,59 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function findFieldsAndFiles() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $id = $this->request["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $lastLog = TalentLogApi::getLastLog($id, ProjectState::INTEGRAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $responseObj = new \stdClass(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($record["checkState"] == IntegralState::SAVE && $lastLog["state"] == IntegralState::VERIFY_REJECT) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $items = $record["detail"]->toArray(); //项目明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $checkState = $record["checkState"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $fields = DictApi::getIntegralFields(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $field_tmp = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            foreach ($fields as $key => $field) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $field_tmp[] = ["key" => $key, "value" => $field]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $record["files"] = $record["modify_files"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $record["fields"] = array_filter(explode(",", $record["modify_fields"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json(["code" => 200, "obj" => ["record" => $record, "fieldList" => $field_tmp]]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $responseObj->code = 200; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $responseObj->id = $id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $responseObj->obj = ["record" => $record, "fieldList" => $field_tmp]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $responseObj->msg = "不是驳回状态不可以编辑驳回内容"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return json($responseObj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function updateFieldsAndFiles() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $id = $this->request["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $fields = array_filter(explode(",", $this->request["fields"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $files = array_filter(explode(",", $this->request["files"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $record = IntegralRecordApi::getOne($id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $lastLog = TalentLogApi::getLastLog($id, ProjectState::INTEGRAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $responseObj = new \stdClass(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($record["checkState"] == IntegralState::SAVE && $lastLog["state"] == IntegralState::VERIFY_REJECT) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!$fields && !$files) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $responseObj->msg = "请选择可修改的字段或附件!"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json($responseObj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $data["id"] = $id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $data["modify_fields"] = $fields ? implode(",", $fields) : null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $data["modify_files"] = $files ? implode(",", $files) : null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                IntegralRecord::update($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $responseObj->code = 200; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $responseObj->msg = "驳回字段修改成功"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json($responseObj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } catch (\think\db\exception\DbException $e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $responseObj->msg = $e->getMessage(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json($responseObj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $responseObj->msg = "不是驳回状态不可以编辑驳回内容"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json($responseObj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function fstVerifyListExport() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -906,6 +995,7 @@ class IntegralVerify extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $names["project"] = "申报项目"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $names["checkState"] = "审核状态"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $names["checkMsg"] = "审核意见"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $names["year"] = "申报年度"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $list = IntegralRecordApi::getExportDatas($process, $fields); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($fields as $field) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $columns[] = $names[$field]; 
			 |