diff --git a/Application.cfc b/Application.cfc index 61ba102..2d4aadd 100644 --- a/Application.cfc +++ b/Application.cfc @@ -76,7 +76,7 @@ - + diff --git a/contragent_rpt.cfm b/contragent_rpt.cfm index 224c6a2..432dc99 100644 --- a/contragent_rpt.cfm +++ b/contragent_rpt.cfm @@ -159,13 +159,14 @@ --AND a.is_actual --AND date_nop <= CURRENT_TIMESTAMP AND COALESCE(date_end,CURRENT_TIMESTAMP) >= CURRENT_TIMESTAMP + AND s.probability_pc >=50 ORDER BY __index --, version::int -

Услуги по данным CRM (версии строк спецификации, только актуальные на сегодня)

+

Услуги по данным CRM (версии строк спецификации, только актуальные на сегодня, сделки с вероятностью от 50% (начиная с тестирования)

@@ -190,7 +191,7 @@ class="gray"> #__index# - #abstractive_service_code#.#modifier_code# + #abstractive_service_code#.#modifier_code# #user_description# @@ -225,11 +226,12 @@ ---> -
#__index##dateFormat(date_nop,'YYYY-MM-DD')# #dateFormat(date_end,'YYYY-MM-DD')##probability_pc# #additional_agreement# (#status_id# #status#)
+ select @@ -328,6 +330,7 @@ Организация + Статус организации VDC Кластер Политика хранения @@ -354,6 +357,51 @@ + + + + select + "Object_UUID"::text + ,"Org" + ,"OrgStatus" + ,"OrgVDC" + ,(select STRING_AGG(DISTINCT "Cluster",',') FROM vmreports.compute c + WHERE ts=(select max(ts) from vmreports.compute) + AND g."Org"=c."Organization") as org_cluster + ,"Name" + ,"GPU" + FROM vmreports.vm_gpu g + WHERE ts=(select max(ts) from vmreports.vm_gpu) + AND lower(g."ClientID")=lower() + + + + +

GPU факт

+ + + + + + + + + + + + + + + + + + + + + + + +
ОрганизацияСтатус организацииVDCКластерVMGPU
#Org##OrgStatus##OrgVDC##org_cluster##Name##GPU#
diff --git a/crm2cloud.cfm b/crm2cloud.cfm index 9290676..35aad5a 100644 --- a/crm2cloud.cfm +++ b/crm2cloud.cfm @@ -60,6 +60,7 @@ WITH AND siv."__deletedAt" IS NULL and d."__deletedAt" IS NULL and a."__deletedAt" IS NULL + and s.probability_pc >= 50 --and a.is_actual and siv.type IN (2,3) ), @@ -196,6 +197,43 @@ WITH z.__id , z.__name ), + sold_gpu as + ( + SELECT + z.id_klienta as WZ , + z.__name as client , + z.__id as company_uid, + round(sum(c.cnt*o.cnt)) as quantity , + count(*) as lines , + STRING_AGG(distinct c.code,', ' order by c.code) as codes + FROM + stair o + JOIN + elma.companies z on (o._companies=z.__id) + LEFT JOIN component c on c.__id = o.param_id + WHERE + --c.code SIMILAR TO 'iaas.(ngc|dcp).%.vcpu%-_' + (c.code LIKE 'iaas.ngc.%.gpu%-_' OR c.code LIKE 'iaas.dcp.%.gpu%-_') + AND c.cnt <> 0 + AND o.cnt <> 0 + GROUP BY + z.id_klienta, + z.__id , + z.__name + ), + gpu_alloc as + ( + select + c."ClientID" as wz , + -- json_agg("GPU") as gpu, + string_agg("GPU"::text||' '||"OrgStatus",', ') as gpu, + count(*) as gpu_alloc + from + vmreports.vm_gpu c + where + ts= (select max(ts) from vmreports.vm_gpu) + group by + c."ClientID" ), deal_stat as ( select @@ -233,6 +271,10 @@ select d.codes as disk_codes d.quantity as disk_sold da.disk_alloc + g.codes as gpu_codes + g.quantity as gpu_sold + ga.gpu_alloc + ga.gpu z.__name as alloc_company z.__id as alloc_company_uid ds.ar_status_ids @@ -241,8 +283,10 @@ from sold_ram r join deal_stat ds on (lower(r.wz)=lower(ds.wz)) join sold_cpu c on (lower(r.wz)=lower(c.wz)) left join sold_disk d on (lower(r.wz)=lower(d.wz)) +left join sold_gpu g on (lower(r.wz)=lower(g.wz)) full join alloc a on (lower(r.wz)=lower(a.wz)) left join disk_alloc da on (a.wz=da.wz) +left join gpu_alloc ga on (a.wz=ga.wz) left join elma.companies z on (lower(a.wz)=lower(z.id_klienta)) where 1=1 order by @@ -316,7 +360,14 @@ S3 операции и трафик: #dateFormat(qS3OpsTrfAge.dt_load,'YYYY-M - + + + + + + + + @@ -350,6 +401,11 @@ S3 операции и трафик: #dateFormat(qS3OpsTrfAge.dt_load,'YYYY-M #disk_codes# style="background:lightgreen;">#disk_sold# style="background:lightcoral;">#disk_alloc# + + #gpu_codes# + style="background:lightgreen;">#gpu_sold# + style="background:lightcoral;">#gpu_alloc# + #gpu# @@ -363,6 +419,7 @@ S3 операции и трафик: #dateFormat(qS3OpsTrfAge.dt_load,'YYYY-M ,sum(ram_alloc_on) as ram_alloc_on ,sum(disk_sold) as disk_sold ,sum(disk_alloc) as disk_alloc + ,sum(gpu_sold) as gpu_sold from qRead
@@ -382,7 +439,10 @@ S3 операции и трафик: #dateFormat(qS3OpsTrfAge.dt_load,'YYYY-M style="background:lightgreen;">#disk_sold# - style="background:lightcoral;">#disk_alloc# + style="background:lightcoral;">#disk_alloc# + + + #gpu_sold#