123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456 |
- <?php
- namespace App\Http\Controllers\Web\Talent;
- libxml_disable_entity_loader(false);
- use App\Http\Controllers\Web\WebBaseController;
- use App\Models\RecruitAppointInfo;
- use App\Models\RecruitAppointSelect;
- use App\Models\RecruitPost;
- use App\Models\RecruitTicket;
- use App\Services\Common\SmsService;
- use Illuminate\Support\Facades\Cache;
- use PhpOffice\PhpSpreadsheet\Spreadsheet;
- use PhpOffice\PhpSpreadsheet\IOFactory;
- use PhpOffice\PhpSpreadsheet\Cell\DataType;
- use PhpOffice\PhpWord\IOFactory as WordIOFactory;
- use PhpOffice\PhpWord\Settings;
- use PhpOffice\PhpWord\TemplateProcessor;
- use Illuminate\Support\Facades\DB;
- use App\Exceptions\ResponseException;
- use Illuminate\Http\Request;
- use App\Services\Common\BaiduService;
- class JjhcController extends WebBaseController
- {
- private $smsService;
- public function __construct(SmsService $smsService)
- {
- $this->smsService = $smsService;
- }
- public function yqfk()
- {
- return view("app.talent.jjhc.yqfk");
- }
- public function chaxun(Request $request)
- {
- $data = array('msg'=>'查无此用户!','status' => 0);
- return response()->json($data);
- $info = DB::connection('fangyi')->table('fillinfo')
- ->where(['lxdh'=>$request->tel])->first();
- if($info){
- $data = array('status'=>1,'msg'=>'查到已存在数据!','info'=>$info);
- }else{
- $data = array('msg'=>'查无此用户!','status' => 0);
- }
- return response()->json($data);
- }
- public function getGuid(){
- $redis = Cache::getRedis();
- $guid = $redis->get('sjhj_guid');
- if(!$guid){
- $client = new \SoapClient("http://222.77.0.158:8090/Convergence/webservice/ConvergenceService?wsdl");
-
- $param = [
- 'userid'=>'jjswzzb_cxz',
- 'password'=>'Cxz@1234'
- ];
- $guid =$client->LoginByAccount ($param);
- $redis->set('sjhj_guid',$guid->return);
- $redis->expire('sjhj_guid',1800);
- return $guid->return;
- }
- return $guid;
- }
- public function push(){
- ini_set('display_errors',1);
- error_reporting(E_ALL);
- $guid = $this->getGuid();
- $index = 0;
- for ($i = 1;$i<=5;$i++){
- $list = DB::connection('report_system')->table("un_talent_info")->offset($index)->limit(500)->get();
- if($list && count($list) > 0){
- $str = '<?xml version="1.0" encoding="UTF-8"?><table>';
- $template = '<row type="add">
- <id name="主键" isattachment="false"><![CDATA[%s]]></id>
- <enterpriseid name="企业id" isattachment="false"><![CDATA[%s]]></enterpriseid>
- <year name="申报年度" isattachment="false"><![CDATA[%s]]></year>
- <type name="人才类型" isattachment="false"><![CDATA[%s]]></type>
- <source name="来源" isattachment="false"><![CDATA[%s]]></source>
- <ourcitysource name="是否我市" isattachment="false"><![CDATA[%s]]></ourcitysource>
- <talenttype name="申报人才类型" isattachment="false"><![CDATA[%s]]></talenttype>
- <cardtype name="证件类型" isattachment="false"><![CDATA[%s]]></cardtype>
- <idcard name="证件号码" isattachment="false"><![CDATA[%s]]></idcard>
- <name name="姓名" isattachment="false"><![CDATA[%s]]></name>
- <photo name="头像" isattachment="false"><![CDATA[%s]]></photo>
- <sex name="性别" isattachment="false"><![CDATA[%s]]></sex>
- <nation name="民族" isattachment="false"><![CDATA[%s]]></nation>
- <nationality name="国籍" isattachment="false"><![CDATA[%s]]></nationality>
- <provincename name="籍贯省名称" isattachment="false"><![CDATA[%s]]></provincename>
- <cityname name="籍贯市名称" isattachment="false"><![CDATA[%s]]></cityname>
- <countyname name="籍贯县名称" isattachment="false"><![CDATA[%s]]></countyname>
- <birthday name="出生日期" isattachment="false"><![CDATA[%s]]></birthday>
- <address name="现居地址" isattachment="false"><![CDATA[%s]]></address>
- <politics name="政治面貌" isattachment="false"><![CDATA[%s]]></politics>
- <higheducation name="最高学历" isattachment="false"><![CDATA[%s]]></higheducation>
- <graduateschool name="毕业学校" isattachment="false"><![CDATA[%s]]></graduateschool>
- <major name="专业" isattachment="false"><![CDATA[%s]]></major>
- <post name="职务" isattachment="false"><![CDATA[%s]]></post>
- <phone name="手机号码" isattachment="false"><![CDATA[%s]]></phone>
- <email name="电子邮箱" isattachment="false"><![CDATA[%s]]></email>
- <bank name="开户银行" isattachment="false"><![CDATA[%s]]></bank>
- <banknetwork name="开户银行网点" isattachment="false"><![CDATA[%s]]></banknetwork>
- <bankaccount name="银行账号" isattachment="false"><![CDATA[%s]]></bankaccount>
- <banknumber name="银行行号" isattachment="false"><![CDATA[%s]]></banknumber>
- <entrytime name="入职时间" isattachment="false"><![CDATA[%s]]></entrytime>
- <starttime name="工作合同开始时间" isattachment="false"><![CDATA[%s]]></starttime>
- <endtime name="工作合同结束时间" isattachment="false"><![CDATA[%s]]></endtime>
- <talentarrange name="人才层次" isattachment="false"><![CDATA[%s]]></talentarrange>
- <identifycondition name="认定条件" isattachment="false"><![CDATA[%s]]></identifycondition>
- <identifygettime name="认定条件获得时间" isattachment="false"><![CDATA[%s]]></identifygettime>
- <identifyconditionname name="认定条件名称" isattachment="false"><![CDATA[%s]]></identifyconditionname>
- <identifymonth name="认定月份" isattachment="false"><![CDATA[%s]]></identifymonth>
- <certificateno name="证书编号" isattachment="false"><![CDATA[%s]]></certificateno>
- <lettertime name="行政介绍信时间" isattachment="false"><![CDATA[%s]]></lettertime>
- <gygb name="是否为我市本级国有股比超过50%%" isattachment="false"><![CDATA[%s]]></gygb>
- <certificatestarttime name="人才证书开始时间" isattachment="false"><![CDATA[%s]]></certificatestarttime>
- <qzgccrcactivetime name="人才证书的有效期" isattachment="false"><![CDATA[%s]]></qzgccrcactivetime>
- <mainhonours name="主要业绩及取得的荣誉" isattachment="false"><![CDATA[%s]]></mainhonours>
- <educationandresume name="教育背景及工作简历" isattachment="false"><![CDATA[%s]]></educationandresume>
- <firstinjjtime name="首次来晋工作时间" isattachment="false"><![CDATA[%s]]></firstinjjtime>
- <isintroduction name="是否引进" isattachment="false"><![CDATA[%s]]></isintroduction>
- <introductionmode name="引进方式" isattachment="false"><![CDATA[%s]]></introductionmode>
- <industryfield name="行业领域" isattachment="false"><![CDATA[%s]]></industryfield>
- <title name="职称" isattachment="false"><![CDATA[%s]]></title>
- <professionalqualifications name="国家职业资格" isattachment="false"><![CDATA[%s]]></professionalqualifications>
- <studyabroad name="是否有留学经历" isattachment="false"><![CDATA[%s]]></studyabroad>
- <studyabroadcountry name="留学国家" isattachment="false"><![CDATA[%s]]></studyabroadcountry>
- <fromcity name="来源县市" isattachment="false"><![CDATA[%s]]></fromcity>
- <qzbatch name="入选泉州高层次人才批次" isattachment="false"><![CDATA[%s]]></qzbatch>
- <breakfaith name="曾被相关部门列为失信人员" isattachment="false"><![CDATA[%s]]></breakfaith>
- </row>';
- foreach ($list as $k => $v){
- $item_str = sprintf($template,$v->id,$v->enterpriseId,$v->year,$v->type,$v->source,$v->ourCitySource,$v->talentType,$v->cardType,$v->idCard
- ,$v->name,$v->photo,$v->sex,$v->nation,$v->nationality,$v->provinceName,$v->cityName,$v->countyName,$v->birthday
- ,$v->address,$v->politics,$v->highEducation,$v->graduateSchool,$v->major,$v->post,$v->phone,$v->email,$v->bank
- ,$v->bankNetwork,$v->bankAccount,$v->bankNumber,$v->entryTime,$v->startTime,$v->endTime,$v->talentArrange,$v->identifyCondition,$v->identifyGetTime
- ,$v->identifyConditionName,$v->identifyMonth,$v->certificateNO,$v->letterTime,$v->gygb,$v->certificateStartTime,$v->qzgccrcActiveTime,$v->mainHonours,$v->educationAndResume
- ,$v->firstInJJTime,$v->isIntroduction,$v->introductionMode,$v->industryField,$v->title,$v->professionalQualifications,$v->studyAbroad,$v->studyAbroadCountry,$v->fromCity
- ,$v->qzBatch,$v->breakFaith);
- $str .= $item_str;
- }
- $str .= '</table>';
- try{
- $client = new \SoapClient('http://61.131.47.134:8756/Convergence/webservice/ConvergenceService?wsdl');
-
- $param = [
- 'guid'=>$guid,
- 'catalogid'=>'WEB2448',
- 'xmlstr' => $str
- ];
- $res = $client->pushXml($param);
- echo $res->return;
- } catch (\Exception $e){
- dd($e->getMessage());
- }
- }
- $index += 500;
- }
- echo $index;
- }
- public function test(Request $request)
- {
- $keyword = $request->input('keyword');
- if($keyword != "j0vOW5mBREZxdo3P"){
- throw new ResponseException("who are you?", [], 404);
- }
- $redis = Cache::getRedis();
- $redis->set('recruit_quota',false);
- echo "success";
- }
- }
|