|  | @@ -2,6 +2,8 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  namespace app\job;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +use app\common\api\TalentLogApi;
 | 
	
		
			
				|  |  | +use app\common\model\TalentChecklog;
 | 
	
		
			
				|  |  |  use think\queue\Job;
 | 
	
		
			
				|  |  |  use think\facade\Log;
 | 
	
		
			
				|  |  |  use think\facade\Db;
 | 
	
	
		
			
				|  | @@ -85,7 +87,7 @@ class Import {
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                      break;
 | 
	
		
			
				|  |  |                                  case 2:
 | 
	
		
			
				|  |  | -                                    $info = Db::table("un_enterprise")->where('idCard', $row[$i])->findOrEmpty();
 | 
	
		
			
				|  |  | +                                    $info = Db::table("un_enterprise")->where('idCard', $row[$i])->where('delete',0)->findOrEmpty();
 | 
	
		
			
				|  |  |                                      if ($info) {
 | 
	
		
			
				|  |  |                                          array_push($msg, "机构代码已存在,请检查");
 | 
	
		
			
				|  |  |                                      } else {
 | 
	
	
		
			
				|  | @@ -144,7 +146,19 @@ class Import {
 | 
	
		
			
				|  |  |                              $sheet->setCellValue('L' . ($index + 2), '导入成功,初始账号为:' . $item['idCard'] . ',初始密码为:' . $password);
 | 
	
		
			
				|  |  |                              $sender = new ChuanglanSmsApi();
 | 
	
		
			
				|  |  |                              $sender->sendSMS($item['agentPhone'], "您好,您的机构信息仍需完善,请登录晋江市人才综合服务申报平台进行完善,您的用户名为:{$item['idCard']},密码为:{$password}。");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +                            TalentChecklog::create([
 | 
	
		
			
				|  |  | +                                'id' => getStringId(),
 | 
	
		
			
				|  |  | +                                'mainId' => $item['id'],
 | 
	
		
			
				|  |  | +                                'type' => 10,
 | 
	
		
			
				|  |  | +                                'typeField' => null,
 | 
	
		
			
				|  |  | +                                'active' => 1,
 | 
	
		
			
				|  |  | +                                'state' => 1,
 | 
	
		
			
				|  |  | +                                'step' => 100,
 | 
	
		
			
				|  |  | +                                'stateChange' => '直认导入',
 | 
	
		
			
				|  |  | +                                'description' => '机构注册',
 | 
	
		
			
				|  |  | +                                'createTime' => date("Y-m-d H:i:s", time()),
 | 
	
		
			
				|  |  | +                                'createUser' => '系统'
 | 
	
		
			
				|  |  | +                            ]);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -193,7 +207,7 @@ class Import {
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                      break;
 | 
	
		
			
				|  |  |                                  case 1:
 | 
	
		
			
				|  |  | -                                    $info = Db::table("un_enterprise")->where('idCard', $row[$i])->findOrEmpty();
 | 
	
		
			
				|  |  | +                                    $info = Db::table("un_enterprise")->where('idCard', $row[$i])->where('delete',0)->findOrEmpty();
 | 
	
		
			
				|  |  |                                      if (!$info) {
 | 
	
		
			
				|  |  |                                          array_push($msg, "机构代码不存在,请检查");
 | 
	
		
			
				|  |  |                                      } else {
 | 
	
	
		
			
				|  | @@ -277,7 +291,6 @@ class Import {
 | 
	
		
			
				|  |  |                          //$item['source'] = 1;
 | 
	
		
			
				|  |  |                          $item['fj_talent_info'] = $str;
 | 
	
		
			
				|  |  |                          $item["checkState"] = \app\common\api\TalentState::SCND_SAVE; //保存未提交
 | 
	
		
			
				|  |  | -                        $item["highProcess"] = 5; //最高进度
 | 
	
		
			
				|  |  |                          $item["isImport"] = 1;//导入人才的标志
 | 
	
		
			
				|  |  |                          $item['fjImport'] = 1;
 | 
	
		
			
				|  |  |                          if (count($msg) >= 1) {
 | 
	
	
		
			
				|  | @@ -287,14 +300,19 @@ class Import {
 | 
	
		
			
				|  |  |                                  $item['updateTime'] = date("Y-m-d H:i:s", time());
 | 
	
		
			
				|  |  |                                  Db::table("new_talent_info")->where('id', $talent_info['id'])->update($item);
 | 
	
		
			
				|  |  |                                  $sheet->setCellValue('AL' . ($index + 2), '更新成功');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                              } else {
 | 
	
		
			
				|  |  | +                                $item["highProcess"] = 5; //最高进度
 | 
	
		
			
				|  |  |                                  $item['createTime'] = date("Y-m-d H:i:s", time());
 | 
	
		
			
				|  |  |                                  Db::table("new_talent_info")->insert($item);
 | 
	
		
			
				|  |  |                                  $sheet->setCellValue('AL' . ($index + 2), '导入成功');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | +                            $log = TalentLogApi::system(1, $talent_info["id"],8,"直认数据导入");
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                      $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
 | 
	
		
			
				|  |  |                      $writer->save($path . "/public/storage/" . $res['task_file']);
 | 
	
		
			
				|  |  |                      Db::table("new_talent_zhiren")->where('id', $id)->update(['task_result' => $res['task_file'], 'task_status' => 1, 'updateTime' => date("Y-m-d H:i:s", time())]);
 | 
	
	
		
			
				|  | @@ -342,7 +360,7 @@ class Import {
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                      break;
 | 
	
		
			
				|  |  |                                  case 1:
 | 
	
		
			
				|  |  | -                                    $info = Db::table("un_enterprise")->where('idCard', $row[$i])->findOrEmpty();
 | 
	
		
			
				|  |  | +                                    $info = Db::table("un_enterprise")->where('idCard', $row[$i])->where('delete',0)->findOrEmpty();
 | 
	
		
			
				|  |  |                                      if (!$info) {
 | 
	
		
			
				|  |  |                                          array_push($msg, "机构代码不存在,请检查");
 | 
	
		
			
				|  |  |                                      } else {
 | 
	
	
		
			
				|  | @@ -449,6 +467,7 @@ class Import {
 | 
	
		
			
				|  |  |                                  Db::table("new_talent_info")->insert($item);
 | 
	
		
			
				|  |  |                                  $sheet->setCellValue('AC' . ($index + 2), '导入成功');
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | +                            $log = TalentLogApi::system(1, $talent_info["id"],8,"直认数据导入");
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |  
 |