imperituroard 1.1.20 → 1.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da7f0fc8144845989685567ed37d05cb510b8710
4
- data.tar.gz: 26bde7ae4b31e772a6684df490a67e8c9aeb1ed2
3
+ metadata.gz: e042da52091fac7c1d66d52634e37ba786a8b78c
4
+ data.tar.gz: 0411bae82c9e4649df353c9c68a73841dfaf2abc
5
5
  SHA512:
6
- metadata.gz: 474535bbe80460b3a8a82ae5dde557ead88620b366e57e3a05136bf0e8ef8f27890731a1b17869b82abd2fbec553d6806f6c1686defaa9340a88b4bd10474bf4
7
- data.tar.gz: c6fa751ba7c5e19ab8c4af411460add46f1eedc19e3bfaec72b9606abc0bfd3d6ae1413830c0c29dbba978b6b7d2d7f2615337294238a2bc06b63f27b74269f5
6
+ metadata.gz: 306ceecd1adfb971b2af29d671f72bd2fe8abcfdb87ea06098c482fac722a0f44a65259aa0c3875d5d3016a17826986fd870c2f6f6479453567970352a95d666
7
+ data.tar.gz: 6e27c6affb06bc0a1932691b82823be16c544c783b687fe46c1a3d6abea28088189090cd0b4ca4d5d79bdd3e4102b29cd3d6906a6f02f68d2805e78990095f41
@@ -34,9 +34,9 @@ class HuaIot
34
34
  def parse_token(str)
35
35
  begin
36
36
  dd = str.split(",")
37
- acc_token = ""
38
- refr_token = ""
39
- exp_in = ""
37
+ acc_token = ''
38
+ refr_token = ''
39
+ exp_in = ''
40
40
 
41
41
  access_token = /"accessToken":"(\S+)"/
42
42
  refresh_token = /"refreshToken":"(.+)"/
@@ -210,23 +210,44 @@ class MhubFunctions_2
210
210
 
211
211
  #for bank dabrabyt
212
212
  def rec_deliv_report_2(params, ip_src, ip_real, ip_vip, crm_slice_num=2)
213
+ internal_func.printer_texter({:mess => 'started function rec_deliv_report_2'}, log_level)
213
214
  input_params = {:params => params, :ip_src => ip_src, :ip_real => ip_real, :ip_vip => ip_vip}
214
215
  output_params = {}
215
216
  hub_resp = {}
217
+ result = {}
216
218
 
219
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step1'}, log_level)
217
220
  begin
218
221
  mes_report = dabrab_connecter.delivery_report_transform(params)[:body][:report_to_recip]
219
- result = crm_connector.crm_status_2(mes_report, crm_slice_num)
220
- if result[:body][:res_body]["GetReportsResult"]==""
221
- output_params = {"code": 200, "result": "Data processed", "body": {"answer": {"code": 200, "status": "Success"}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
222
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step2'}, log_level)
223
+
224
+ begin
225
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step2.1'}, log_level)
226
+ result = crm_connector.crm_status_2(mes_report, crm_slice_num)
227
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step2.2'}, log_level)
228
+ rescue
229
+ result = {:code => 505505, :result => 'Error', :body => {:res_body => 'Error communication with crm'}}
230
+ end
231
+
232
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step3'}, log_level)
233
+ if result[:body][:res_body] == ''
234
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step4'}, log_level)
235
+ output_params = {'code': 200, 'result': 'Data processed', 'body': {'answer': {'code': 200, 'status': 'Success'}, 'sender': {'ip_src': ip_src, 'ip_real': ip_real, 'ip_vip': ip_vip}}}
236
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step5'}, log_level)
237
+ elsif result[:code] == 505505
238
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step5.1'}, log_level)
239
+ output_params = {'code': 505, 'result': 'Data processed', 'body': {'answer': {'code': 505, 'status': 'Error communicate with dabrabyt'}, 'sender': {'ip_src': ip_src, 'ip_real': ip_real, 'ip_vip': ip_vip}}}
240
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step5.2'}, log_level)
222
241
  else
223
- output_params = {"code": 202, "result": "CRM returned error #{result[:body][:res_body]["GetReportsResult"].to_s}", "body": {"answer": {"code": 200, "status": "Success"}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
242
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step6'}, log_level)
243
+ output_params = {'code': 202, 'result': "CRM returned error #{result[:body][:res_body]['GetReportsResult'].to_s}", 'body': {'answer': {'code': 200, 'status': 'Success'}, 'sender': {'ip_src': ip_src, 'ip_real': ip_real, 'ip_vip': ip_vip}}}
244
+ internal_func.printer_texter({:mess => 'rec_deliv_report_2 step7'}, log_level)
224
245
  end
225
246
  rescue
226
- output_params = {"code": 500, "result": "MhubFunctions_2.rec_deliv_report_2: Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
247
+ output_params = {'code': 500, 'result': 'MhubFunctions_2.rec_deliv_report_2: Unknown SDK error', 'body': {'answer': {}, 'sender': {'ip_src': ip_src, 'ip_real': ip_real, 'ip_vip': ip_vip}}}
227
248
  telegram_connector.telegram_message(output_params)
228
249
  end
229
- internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => "Mhub_2.recieve_delivery_report"}, log_level)
250
+ internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => 'Mhub_2.recieve_delivery_report'}, log_level)
230
251
  output_params
231
252
  end
232
253
 
@@ -22,11 +22,13 @@ class Crm_2
22
22
 
23
23
  begin
24
24
 
25
- internal_func.printer_texter({:input => "Start process", :procedure => "Crm_2.crm_status_2"}, log_level)
25
+ internal_func.printer_texter({:input => 'Start process', :procedure => "Crm_2.crm_status_2"}, log_level)
26
26
 
27
27
 
28
28
  thr_crm_status_2 = Thread.new do
29
29
 
30
+ internal_func.printer_texter({:input => 'Thread start', :procedure => 'Crm_2.crm_status_2'}, log_level)
31
+
30
32
  partnnn = crm_payload[:results].each_slice(slice_num).to_a
31
33
 
32
34
  partnnn.each { |one_part_reports|
@@ -37,6 +39,8 @@ class Crm_2
37
39
  uri = URI(crm_callback_url)
38
40
  #8 - client id
39
41
 
42
+ internal_func.printer_texter({:input => 'before net', :procedure => 'Crm_2.crm_status_2'}, log_level)
43
+
40
44
  https = Net::HTTP.new(uri.host, uri.port)
41
45
  https.use_ssl = true
42
46
  https.verify_mode = OpenSSL::SSL::VERIFY_NONE
@@ -54,10 +58,19 @@ class Crm_2
54
58
 
55
59
  internal_func.printer_texter({:input => "Before send request to crm", :procedure => "Crm_2.crm_status_2"}, log_level)
56
60
 
57
- res = https.request(req)
61
+ begin
62
+
63
+ res = https.request(req)
64
+ internal_func.printer_texter({:input => "After send request to crm Ok", :procedure => "Crm_2.crm_status_2"}, log_level)
65
+ internal_func.printer_texter({:input => {:res_code => res.code, :res_body => res.body.to_s}, :procedure => "Crm_2.crm_status_2"}, log_level)
66
+
67
+ rescue
68
+
69
+ res = 'dabrabyt error'
70
+ internal_func.printer_texter({:input => "After send request to crm error", :procedure => "Crm_2.crm_status_2"}, log_level)
71
+ internal_func.printer_texter({:input => {:res_code => "500", :res_body => res}, :procedure => "Crm_2.crm_status_2"}, log_level)
58
72
 
59
- internal_func.printer_texter({:input => "After send request to crm", :procedure => "Crm_2.crm_status_2"}, log_level)
60
- internal_func.printer_texter({:input => {:res_code => res.code, :res_body => res.body.to_s}, :procedure => "Crm_2.crm_status_2"}, log_level)
73
+ end
61
74
 
62
75
  }
63
76
 
@@ -1,4 +1,4 @@
1
1
  module Imperituroard
2
- VERSION = '1.1.20'
2
+ VERSION = '1.1.21'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imperituroard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.20
4
+ version: 1.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-30 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler