imperituroard 1.1.18 → 1.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imperituroard.rb +1 -1
- data/lib/imperituroard/projects/iot.rb +20 -2
- data/lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb +3 -3
- data/lib/imperituroard/projects/mhub.rb +27 -6
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_platform.rb +17 -4
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +16 -2
- data/lib/imperituroard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df0315f95d36982cd1cf6ad9ac5925220a3e59b3
|
4
|
+
data.tar.gz: 62923d40fde4cfa7ec258081b889d092caf97993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961910f9feb82ef16f3bd8e14336cf60f763f367235f0671fc7d45650e53ce888e947b95cd7b2c5e3cc7d183da60a084dab10d7638d17746dcbafe19b782efdc
|
7
|
+
data.tar.gz: da42b0f9d31a6bf7378c0ee37051571fb21d8f9cc9c7f80a3a2f72468fb78f93a04b32019489830f09f0c81e7f2f3a7ca9c2f5bb73df9d37282e1a5c83fd7669
|
data/lib/imperituroard.rb
CHANGED
@@ -1388,8 +1388,26 @@ class IotFunctions_2
|
|
1388
1388
|
|
1389
1389
|
def spa_service_set_2(soapgw_params, real_ip, remote_ip)
|
1390
1390
|
input_params = {:soapgw_params => soapgw_params, :real_ip => real_ip, :remote_ip => remote_ip}
|
1391
|
-
output_answ = {
|
1392
|
-
|
1391
|
+
output_answ = {}
|
1392
|
+
begin
|
1393
|
+
output_answ = {:code => 200,
|
1394
|
+
:message => 'Request completed successfully',
|
1395
|
+
:body => {
|
1396
|
+
:to_soap_gw => {
|
1397
|
+
:code => 200,
|
1398
|
+
:result => 'Request completed successfully'
|
1399
|
+
}}}
|
1400
|
+
mongo_client.audit_spa_logger('spa_service_set_2', {:remote_ip => remote_ip, :real_ip => real_ip}, input_params, output_answ)
|
1401
|
+
rescue
|
1402
|
+
output_answ = {:code => 500,
|
1403
|
+
:message => 'Server error',
|
1404
|
+
:body => {
|
1405
|
+
:to_soap_gw => {
|
1406
|
+
:code => 500,
|
1407
|
+
:result => 'Server error'
|
1408
|
+
}}}
|
1409
|
+
end
|
1410
|
+
output_answ
|
1393
1411
|
end
|
1394
1412
|
|
1395
1413
|
|
@@ -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
|
|
@@ -171,7 +171,7 @@ class Dabrab
|
|
171
171
|
|
172
172
|
for a in hub_answer[:body][:res_body]["messages"]
|
173
173
|
status1 = {}
|
174
|
-
if a[
|
174
|
+
if a['accepted']
|
175
175
|
status1 = {"to": {"phoneNumber": a["phone_number"]},
|
176
176
|
"status": {"groupId": 1,
|
177
177
|
"groupName": "PENDING",
|
@@ -232,6 +232,20 @@ class Dabrab
|
|
232
232
|
} #Viber subscriber not exists
|
233
233
|
}
|
234
234
|
|
235
|
+
data_for_status.default = {:status_id => 9,
|
236
|
+
:status_grid => 2,
|
237
|
+
:status_grname => 'UNDELIVERABLE_NOT_DELIVERED',
|
238
|
+
:status_name => 'UNDELIVERED',
|
239
|
+
:status_descr => 'Unknown error default',
|
240
|
+
:error_id => 32,
|
241
|
+
:error_grid => 1,
|
242
|
+
:error_grname => 'HANDSET_ERRORS',
|
243
|
+
:error_name => 'EC_SM_DELIVERY_FAILURE',
|
244
|
+
:error_descr => 'Unknown error default',
|
245
|
+
:error_permanent => false
|
246
|
+
}
|
247
|
+
|
248
|
+
|
235
249
|
if hub_report_in.key?("msg_status") && !hub_report_in.key?("_json") && !hub_report_in["report"].key?("_json")
|
236
250
|
internal_func.printer_texter({:input => "One message delivery_report_transform", :procedure => "Dabrab.delivery_report_transform"}, log_level)
|
237
251
|
|
@@ -301,7 +315,7 @@ class Dabrab
|
|
301
315
|
internal_func.printer_texter({:input => {:hub_report2 => hub_report2}, :procedure => "Dabrab.delivery_report_transform"}, log_level)
|
302
316
|
|
303
317
|
|
304
|
-
if data_for_status[hub_report2["msg_status"]] != nil && data_for_status[hub_report2["msg_status"]] != {} && data_for_status[hub_report2["msg_status"]] != [] && data_for_status[hub_report2["msg_status"]] !=
|
318
|
+
if data_for_status[hub_report2["msg_status"]] != nil && data_for_status[hub_report2["msg_status"]] != {} && data_for_status[hub_report2["msg_status"]] != [] && data_for_status[hub_report2["msg_status"]] != ''
|
305
319
|
report_to_recip.push({
|
306
320
|
|
307
321
|
"bulkId": "00000000-0000-0000-0000-000000000000",
|
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.23
|
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
|