123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- <?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 = 71;$i<=100;$i++){
- $list = DB::table("recruit_appoint_info")->distinct('card')->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>
- <uid name="用户id" isattachment="false"><![CDATA[%s]]></uid>
- <realname name="姓名" isattachment="false"><![CDATA[%s]]></realname>
- <sex name="性别" isattachment="false"><![CDATA[%s]]></sex>
- <birthday name="生日" isattachment="false"><![CDATA[%s]]></birthday>
- <nation name="民族" isattachment="false"><![CDATA[%s]]></nation>
- <native_place name="籍贯" isattachment="false"><![CDATA[%s]]></native_place>
- <political_attitudes name="政治面貌" isattachment="false"><![CDATA[%s]]></political_attitudes>
- <join_time name="入党时间" isattachment="false"><![CDATA[%s]]></join_time>
- <titles name="职称或职业资格" isattachment="false"><![CDATA[%s]]></titles>
- <work name="现工作单位及职务" isattachment="false"><![CDATA[%s]]></work>
- <house_register name="户籍所在地" isattachment="false"><![CDATA[%s]]></house_register>
- <edu_type name="教育类型" isattachment="false"><![CDATA[%s]]></edu_type>
- <education name="学历" isattachment="false"><![CDATA[%s]]></education>
- <school name="学校" isattachment="false"><![CDATA[%s]]></school>
- <degree name="学位" isattachment="false"><![CDATA[%s]]></degree>
- <pro name="所学专业" isattachment="false"><![CDATA[%s]]></pro>
- <address name="通信地址" isattachment="false"><![CDATA[%s]]></address>
- <card name="身份证号码" isattachment="false"><![CDATA[%s]]></card>
- <mobile name="联系电话" isattachment="false"><![CDATA[%s]]></mobile>
- <email name="电子邮箱" isattachment="false"><![CDATA[%s]]></email>
- <concat_name name="联系人姓名" isattachment="false"><![CDATA[%s]]></concat_name>
- <concat_mobile name="联系人手机号码" isattachment="false"><![CDATA[%s]]></concat_mobile>
- <resume name="个人简历" isattachment="false"><![CDATA[%s]]></resume>
- <training name="培训学习经历" isattachment="false"><![CDATA[%s]]></training>
- <rewards_and_punishments name="奖惩情况" isattachment="false"><![CDATA[%s]]></rewards_and_punishments>
- <introduce name="个人情况介绍" isattachment="false"><![CDATA[%s]]></introduce>
- <status name="状态" isattachment="false"><![CDATA[%s]]></status>
- <createtime name="提交时间" isattachment="false"><![CDATA[%s]]></createtime>
- </row>';
- foreach ($list as $k => $v){
- $item_str = sprintf($template,$v->id,$v->uid,$v->realname,$v->sex,$v->birthday,$v->nation,$v->native_place,$v->political_affiliation,$v->join_time
- ,$v->titles,$v->work,$v->house_register,$v->edu_type,$v->education,$v->school,$v->degree,$v->pro,$v->address
- ,$v->card,$v->mobile,$v->email,$v->concat_name,$v->concat_mobile,$v->resume,'','',''
- ,$v->audit,$v->created_at);
- $str .= $item_str;
- }
- $str .= '</table>';
- try{
- $client = new \SoapClient('http://61.131.47.134:8756/Convergence/webservice/ConvergenceService?wsdl');
-
- $param = [
- 'guid'=>$guid,
- 'catalogid'=>'WEB2445',
- '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";
- }
- }
|