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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e042da52091fac7c1d66d52634e37ba786a8b78c
|
4
|
+
data.tar.gz: 0411bae82c9e4649df353c9c68a73841dfaf2abc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
220
|
-
|
221
|
-
|
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
|
-
|
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 = {
|
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 =>
|
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 =>
|
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
|
-
|
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
|
-
|
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
|
|
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.
|
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
|
+
date: 2020-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|