demo.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <?php
  2. use Tool\ShanTaoTool\Bean\ElasticSearch\CreateLogDocParamBean;
  3. use Tool\ShanTaoTool\EsTool;
  4. require_once "./vendor/autoload.php";
  5. //$url = "www.baidu.com";
  6. //$url = "https://runion.meituan.com/url?key=765f44a936837a4c8a347d7e6576cf69&url=https%3A%2F%2Fcube.meituan.com%2Fawp%2Fhfe%2Fblock%2Fa945391288b790d558b7%2F78716%2Findex.html%3Fappkey%3D765f44a936837a4c8a347d7e6576cf69%3A1234561&sid=1234561";
  7. //var_dump(\Tool\ShanTaoTool\QiWeiTool::sendImgTxtToBaoJing(
  8. // "http://image.vv-tool.com/meituan.jpg",
  9. // $url,
  10. // "美团外卖",
  11. // "外卖领券",
  12. // "daogouqun")
  13. //);
  14. //var_dump(\Tool\ShanTaoTool\QiWeiTool::sendImgToBaoJing("2.png","daogouqun"));
  15. //var_dump(\Tool\ShanTaoTool\BaseAuth\AdminAuth::login("hujie1","123456","88888888"));
  16. //var_dump(\Tool\ShanTaoTool\BaseAuth\AdminAuth::getAuth());
  17. //var_dump(\Tool\ShanTaoTool\QiWeiTool::sendMessageToBaoJing("ceshi"));
  18. //$head = ["测试","名字"];
  19. //$data = [
  20. // [
  21. // "测试","anii"
  22. // ],
  23. // [
  24. // "skdh","ksi8"
  25. // ]
  26. //];
  27. //\Tool\ShanTaoTool\ExcelTool::exportToCsv($head,$data,"ceshi");
  28. //
  29. //
  30. //$channel = $connection->channel();
  31. //
  32. //echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
  33. //
  34. //$callback = function($msg) {
  35. // echo " [x] Received ", $msg->body, "\n";
  36. // $data = json_decode($msg->body,true);
  37. // $bean = new CreateLogDocParamBean($data);
  38. // $res = EsTool::createLogDoc($bean);
  39. // var_dump($res);
  40. //};
  41. //
  42. //$channel->basic_consume('vtoolLogQueue', '', false, true, false, false, $callback);
  43. //
  44. //while(count($channel->callbacks)) {
  45. // $channel->wait();
  46. //}
  47. //
  48. //$channel->close();
  49. //$connection->close();
  50. //测试es
  51. //$data = [
  52. // "requestParams"=>json_encode(["name"=>"mark"]),
  53. // "requestResponse"=>json_encode(["age"=>29]),
  54. // "requestPath"=>"/ceshi/path",
  55. // "requestLog"=>json_encode(["ceshi","自定义日志"]),
  56. // "requestSqlLog"=>json_encode(["insel sql","update sql"]),
  57. // "requestProjectName"=>"vtool",
  58. // "createdAt"=>"1611916077.8329",
  59. // "updatedAt"=>"1611916231.7019",
  60. // "requestId"=>1611916231,
  61. // "uniqueTraceId"=>md5(1234)
  62. //];
  63. //$bean = new \Tool\ShanTaoTool\Bean\ElasticSearch\CreateLogDocParamBean($data);
  64. //$res = \Tool\ShanTaoTool\EsTool::createLogDoc($bean);
  65. //var_dump($res);
  66. //var_dump($data);
  67. //
  68. //\Tool\ShanTaoTool\ElasticSearch\ElasticSerach::getElasticSearchClient();
  69. //$client = \Tool\ShanTaoTool\ElasticSearch\ElasticSerach::$client;
  70. //$param = [
  71. // "index"=>"2021-03-08",
  72. // "projectName"=>"vtool",
  73. //// "requestPath"=>"doc/apps/docs",
  74. // "page"=>1,
  75. // "pageSize"=>2,
  76. // "unique_trace_id"=>"81dc9bdb52d04dc20036dbd8313ed055"
  77. //];
  78. //$bean = new \Tool\ShanTaoTool\Bean\ElasticSearch\GetLogDocParamBean($param);
  79. //$data = \Tool\ShanTaoTool\EsTool::getLogDoc($bean);
  80. //var_dump($data);
  81. //ini_set("memory_limit",-1);
  82. //
  83. //$datas = \Tool\ShanTaoTool\ExcelTool::importExcel("1.xlsx");
  84. //$heades = [];
  85. //$headData = json_decode($datas[1][1],true);
  86. //foreach ($headData as $key=>$val){
  87. // if(!is_array($val)){
  88. // $heades[] = $key;
  89. // }
  90. //}
  91. //
  92. //$res = [];
  93. //foreach ($datas as $k=>$data){
  94. // if($k>0){
  95. // $tmps = json_decode($data[1],true);
  96. // foreach ($tmps as $tmpKey=>$kv){
  97. // if(!is_array($kv)){
  98. // if(in_array($tmpKey,["inputDate","actionDate","amoytocustomerDate"])){
  99. // if($kv){
  100. // $kv = " ".date("Y-m-d H:i:s",$kv/1000);
  101. // }
  102. // }
  103. // $res[$k-1][]=$kv;
  104. // }
  105. // }
  106. // }
  107. //
  108. //}
  109. //var_dump("数据总数:".count($res));
  110. ////\Tool\ShanTaoTool\ExcelTool::exportToCsv($heades,$res,"修正");
  111. ////打开PHP文件句柄,php://output,表示直接输出到浏览器
  112. //$fp = fopen("修正.csv","a+");
  113. //fwrite($fp, chr(0xEF).chr(0xBB).chr(0xBF)); // 添加 BOM
  114. ////输出Excel列表名称信息
  115. //$headerList = $heades;
  116. //foreach ($headerList as $key => $value) {
  117. //// $headerList[$key] = iconv('UTF-8', 'GBK', $value);//CSV的EXCEL支持BGK编码,一定要转换,否则乱码
  118. // $headerList[$key] = $value;//CSV的EXCEL支持BGK编码,一定要转换,否则乱码
  119. //}
  120. ////使用fputcsv将数据写入文件句柄
  121. //fputcsv($fp, $headerList);
  122. ////计数器
  123. //$num = 0;
  124. ////每隔$limit行,刷新一下输出buffer,不要太大亦不要太小
  125. //$limit = 100000;
  126. //$data = $res;
  127. ////逐行去除数据,不浪费内存
  128. //$count = count($data);
  129. //for($i = 0 ; $i < $count ; $i++){
  130. // $num++;
  131. // //刷新一下输出buffer,防止由于数据过多造成问题
  132. //// if($limit == $num){
  133. //// ob_flush();
  134. //// flush();
  135. //// $num = 0;
  136. //// }
  137. // $row = $data[$i];
  138. // foreach ($row as $key => $value) {
  139. // $value = is_numeric($value) ? $value."\t" : $value;//解决输出长度较长的数字型变成科学计数法
  140. // $row[$key] = $value;
  141. //// $row[$key] = iconv('UTF-8', 'GBK', $value);
  142. // }
  143. // fputcsv($fp, $row);
  144. //}
  145. //fclose($fp);
  146. //$txt = \Tool\ShanTaoTool\QrTool::getQrContent("http://oss.taobao2622.top/WechatIMG3.jpeg");
  147. //var_dump($txt);
  148. //$re = \Tool\ShanTaoTool\SendEmail::sendEmail("底单处理通知","v兔工具",'1152888295@qq.com',"<p data-we-empty-p=''>尊敬的用户:</p><p>您提交的关于包裹id:包裹idxxx,快递公司:快递公司xxx,快递单号:快递单号xxx,申请的底单已经完成申请,</p><p>以下电子面单:</p><p><img src='底单图片xxx' style='max-width:50%;'><br></p><p><br></p><p>如果需要查看详情,点击http://www.vv-tool.com/store/list,如果有什么问题请及时联系网站客服<br></p><p></p><p></p><p>备注:备注xxx</p><hr><p data-we-empty-p=''>v兔电商工具</p>");
  149. //var_dump($re);
  150. //$res = \Tool\ShanTaoTool\Pdd\Ddk\DdkDaogouService::goodsPidGenerate(1);
  151. //$res = \Tool\ShanTaoTool\Pdd\Ddk\DdkDaogouService::goodsPidQuery(1,10,0);
  152. //$bean = [
  153. // "pid"=>"14844776_209372830",
  154. // "generateWeApp"=>"true",
  155. // "resourceType"=>\Tool\ShanTaoTool\Enum\Pdd\Ddk\DdkResourceTypeEnum::RESOURCE_HUOCHEPIAO
  156. //];
  157. //$bean = new \Tool\ShanTaoTool\Bean\Pdd\Ddk\ResourceUrlGenParamBean($bean);
  158. //$res = \Tool\ShanTaoTool\Pdd\Ddk\DdkDaogouService::resourceUrlGen($bean);
  159. //$bean = new \Tool\ShanTaoTool\Bean\Pdd\Ddk\OrderListRangeGetParamBean(
  160. // [
  161. // "startTime"=>"2021-05-18 13:50:00",
  162. // "endTime"=>"2021-05-18 15:19:00",
  163. // ]
  164. //);
  165. //$res = \Tool\ShanTaoTool\Pdd\Ddk\DdkDaogouService::orderListRangeGet($bean);
  166. //$res = \Tool\ShanTaoTool\Sms\QidianyunSms::send("18768452697","1334");
  167. //var_dump($res);
  168. $str = "ceshi";
  169. $params = [
  170. "fileName"=>"1.jpg",
  171. "qrContent"=>"nicai",
  172. "qrSize"=>20,
  173. "logoName"=>"1.jpeg"
  174. ];
  175. $bean = new \Tool\ShanTaoTool\Bean\Qr\CreateQrLogoImgServiceParamBean($params);
  176. $res = \Tool\ShanTaoTool\QrTool::createQrLogoImg($bean);
  177. var_dump($res);