Автоматизация новых точек — различия между версиями

Материал из wiki.standart-n.ru
Перейти к: навигация, поиск
(Новая страница: «== Ссылки на дистрибы == https://www.standart-n.ru/files/source.html == Инструкция по настройке автоматизации…»)
(нет различий)

Версия 15:30, 18 июля 2022

Ссылки на дистрибы

https://www.standart-n.ru/files/source.html

Инструкция по настройке автоматизации торговли Стандарт

Файл:Инструкция по настройке автоматизации торговли Стандарт 18-07-2022.zip

Скрипт для чистки клона клиентов

Должен выполнять без ошибок кроме таблиц LLT$DOCS и LLT$DOC_DETAIL

-- 02.02.2022 Добавлена чистка Интернет заказов Мегаптека.ру
delete from MA$PROT;
SET GENERATOR GEN_MA$PROT_ID TO 0;
delete from I_ORDER_TASKS;
SET GENERATOR gen_i_order_tasks_id TO 0;
delete from I_ORDERS;
SET GENERATOR gen_i_orders_id TO 0;
delete from I_ORDER_DETAIL;
SET GENERATOR gen_i_order_detail_id TO 0;

--11.08.2019 Добавлена чистка для АУ (Слава сказал обязательно)
delete from LLT$DOCS;
delete from LLT$DOC_DETAIL;
delete from ORDER_DATA;
delete from I_ORDERS;
delete from I_ORDER_DETAIL;

--05/02/2021 AVO -->
delete from MARK_DETAIL;
SET GENERATOR GEN_MARK_DETAIL_ID TO 0;
ALTER TRIGGER MARK_DETAIL_TREB_AD_DISTR INACTIVE;
delete from MARK_DETAIL_TREB;
delete from MARK_REQUESTS;
SET GENERATOR GEN_MARK_REQUESTS_ID TO 0;

delete from OUT$INKASS;
SET GENERATOR GEN_OUT$INKASS_ID TO 0;
delete from ANALYTIC_ANALIZ_TT;
SET GENERATOR GEN_ANALYTIC_ANALIZ_TT TO 0;
delete from REGISTRVZAIM;
SET GENERATOR GEN_REGISTRVZAIM_ID TO 0;
delete from REQUEST_HOZ;
SET GENERATOR GEN_REQUEST_HOZ_ID TO 0;
delete from DOC_HW;
SET GENERATOR GEN_DOC_HW_ID TO 0;
-- <--

--Добавлено в чистку 09/01/2020 AVO -->
delete from SVODDATA;
delete from DOCS_PRIHOD_CONTROL;
delete from LABFAS;
SET GENERATOR gen_labfas_id TO 0;
delete from parts_history; 
SET GENERATOR gen_parts_history_id TO 0;
delete from OUT$TRADERS;
SET GENERATOR gen_OUT$TRADERS_id TO 0;
delete from QUANT_FAS;
SET GENERATOR gen_QUANT_FAS_id TO 0;
-- <--


--19.06.2019 Добавлена чистка проблемной таблицы
delete from doc_pays;
SET GENERATOR GEN_DOC_PAYS_ID TO 0;
--end 19.06.2019

delete from PRICES;
SET GENERATOR gen_prices_id TO 0;
--Отключаем режим все партии
ALTER TRIGGER AGENTS_WP_AIU0 INACTIVE;
ALTER TRIGGER PARTS_WP_AIU0 INACTIVE;
ALTER TRIGGER WARES_WP_AIU0 INACTIVE;

delete from ANALYTIC_DOC_DETAIL_1;
SET GENERATOR gen_analytic_doc_detail_1_id TO 0;

delete from ANALYTIC_DOC_DETAIL_2;
SET GENERATOR gen_analytic_doc_detail_2_id TO 0;

delete from ANALYTIC_DOC_DETAIL_4;
SET GENERATOR gen_analytic_doc_detail_4_id TO 0;

delete from ANALYTIC_DOC_DETAIL_8;
SET GENERATOR gen_analytic_doc_detail_8_id TO 0;

-- AVO 09/01/2020 -->
delete from ANALYTIC_ANALIZ_TT;
SET GENERATOR GEN_ANALYTIC_ANALIZ_TT TO 0;

delete from ANALYTIC_DOC_DETAIL_MALOHOD;

delete from ANALYTIC_FALSIFICAT;
SET GENERATOR gen_ANALYTIC_FALSIFICAT_id TO 0;

delete from ANALYTIC_GNVLS;
SET GENERATOR gen_ANALYTIC_GNVLS_id TO 0;

delete from ANALYTIC_MIN_ASSORT;
SET GENERATOR gen_ANALYTIC_MIN_ASSORT_id TO 0;

delete from ANALYTIC_PRICE;
SET GENERATOR gen_ANALYTIC_PRICE_id TO 0;
--09/01/2020 <--

delete from ANALYTIC_MIN_ENDT;
SET GENERATOR gen_analytic_enddt_id TO 0;

delete from ANALYTIC_DOCS;
SET GENERATOR gen_analytic_docs_id TO 0;

delete from CASH_DOCS;
SET GENERATOR gen_cash_docs_id TO 0;
ALTER SEQUENCE GEN_CASH_DOCS_PACKET RESTART WITH 0;

delete from CASH_DOC_DETAIL;
SET GENERATOR GEN_CASH_DOCS_DETAIL_ID TO 0;

delete from ACTIVEUSERS;

delete from WAREBASE;

delete from DOCS_LOG;
SET GENERATOR GEN_DOCS_LOG_ID TO 0;

delete from DSC_LOG;
SET GENERATOR gen_dsclog_id TO 0;

delete from DOC_DETAIL_ACTIVE_MMBSH;

delete from GROUP_DETAIL where GROUPTABLE='PARTS';

delete from DOC_DETAIL_VIRTUAL;
delete from DOC_DETAIL_TRADERS;

delete from LABFAS;
SET GENERATOR gen_labfas_id TO 0;

delete from DOC_DETAIL_LOG;
SET GENERATOR gen_doc_detail_log_id TO 0;

ALTER TRIGGER DOC_DETAIL_AD0 INACTIVE;
delete from DOC_DETAIL;
SET GENERATOR gen_doc_detail_id TO 0;
ALTER TRIGGER DOC_DETAIL_AD0 ACTIVE; 

delete from DOC_DETAIL_ACTIVE;
SET GENERATOR gen_doc_detail_active_id TO 0;

delete from DOC_DETAIL_ACTIVE_LOG;
SET GENERATOR GEN_DOC_DETAIL_ACTIVE_LOG_ID TO 0;

delete from DOC_DETAIL_DELETED;
SET GENERATOR gen_DOC_DETAIL_DELETED_id TO 0;

delete from DOC_DETAIL_ACTIVE_NAMEID;

update PARTS set doc_id=0, session_id=0, contract_id=0;

delete from PARTS_LOG;
SET GENERATOR GEN_PARTS_LOG_ID TO 0;


delete from SHIFT_DETAIL_KKM;
SET GENERATOR GEN_SHIFT_DETAIL_KKM_ID TO 0;

delete from DOC_DETAIL_ACTIVE_CANCELED;
delete from DOCS_CANCELED;


delete from DOCS where id<>0;
SET GENERATOR gen_docs_id TO 0;
ALTER SEQUENCE GEN_DOCS_PACKET RESTART WITH 0;
update docs set packet=0, COMMITSESSION_ID = 0, audit_id=0;

delete from DOCS_CANCELED where id>0;

delete from warebasefolders;

delete from CONTRACTS where id>0;
SET GENERATOR gen_CONTRACTS_id TO 0;

update SP$PRIVILEGES set SP$GRANTORSESSION_ID = 0;

delete from SESSIONS where id>0;
SET GENERATOR gen_sessions_id TO 0;

delete from WORKSTATIONS where id>0;
SET GENERATOR gen_workstations_id TO 0;

delete from ZAKAZ_TMS;
SET GENERATOR GEN_ZAKAZ_TMS_ID TO 0;

delete from W$INV_DETAIL;
SET GENERATOR gen_w$inv_detail_id TO 0;

delete from W$INV;
SET GENERATOR gen_inv_id TO 0;

delete from ANALYTIC_DOC_DETAIL_MALOHOD;
SET GENERATOR gen_analytic_doc_detail8_id TO 0;

delete from ANALYTIC_MIN_ENDT;
SET GENERATOR gen_analytic_enddt_id TO 0; 

delete from HUMAN_ACTION_LOGS;

delete from INV_BARCODES;
SET GENERATOR GEN_INV_BARCODES_ID TO 0;

delete from OUT$MONITORING; 
SET GENERATOR GEN_OUT$MONITORING_ID TO 0;

delete from OUT$MONITORING_LS;

--Добавлено в чистку 09/01/2020 AVO -->
delete from SVODDATA;
delete from DOCS_PRIHOD_CONTROL;
delete from LABFAS;
SET GENERATOR gen_labfas_id TO 0;
delete from parts_history; 
SET GENERATOR gen_parts_history_id TO 0;
delete from OUT$TRADERS;
SET GENERATOR gen_OUT$TRADERS_id TO 0;
delete from QUANT_FAS;
SET GENERATOR gen_QUANT_FAS_id TO 0;
-- <--

ALTER TRIGGER WARES_TREB_AD_DISTR INACTIVE;
delete from WARES_TREB;
SET GENERATOR GEN_WARES_TREB_ID TO 0;
ALTER TRIGGER WARES_TREB_AD_DISTR ACTIVE;

delete from WARES_WORK;

update vals set packet=0 where id='0';
update wares set packet=0 where id='0';
update parts set packet=0 where id='0';
update docs set packet=0 where id='0';

delete from Z$SYNC_DELETED;

Delete from Z$SERVICE;
SET GENERATOR gen_z$service_id TO 0;

--Delete from WAREBASE_DISTR;

delete from RECEPTS;
SET GENERATOR GEN_RECEPTS_ID TO 0;

delete from ATTRIBUTE_DETAIL;
SET GENERATOR GEN_ATTRIBUTE_DETAIL_ID TO 0;

--Добавлено в чистку 20180213 AVO
ALTER TRIGGER DOCS_TREB_AD_DISTR INACTIVE;
delete from DOCS_TREB;
SET GENERATOR GEN_DOCS_TREB_ID TO 0;
ALTER TRIGGER DOCS_TREB_AD_DISTR ACTIVE;

ALTER TRIGGER DOC_DETAIL_ACTIVE_TREB_AD_DISTR INACTIVE;
delete from DOC_DETAIL_ACTIVE_TREB;
SET GENERATOR GEN_DOC_DETAIL_ACTIVE_TREB_ID TO 0;
ALTER TRIGGER DOC_DETAIL_ACTIVE_TREB_AD_DISTR ACTIVE;

delete from DOC_DETAIL_ACTIVE_CANCELED;
delete from DOC_DETAIL_VIRTUAL;
delete from WAREBASE_G;
--20180213 <--

-->20150604
commit work;
update PARAMS set d$uuid=UUID_TO_CHAR(GEN_UUID()); 
commit work;
update PARTS set d$uuid=UUID_TO_CHAR(GEN_UUID());
commit work;
update SESSIONS set d$uuid=UUID_TO_CHAR(GEN_UUID());
commit work;
update USERS set d$uuid=UUID_TO_CHAR(GEN_UUID());
commit work;
update DOCS set d$uuid=UUID_TO_CHAR(GEN_UUID());
commit work;
update DOCS_CANCELED set d$uuid=UUID_TO_CHAR(GEN_UUID());
commit work;

update params set param_value='' where param_id='EGAIS_FSRARID';
update params set param_value='0' where param_id='EGAIS_AUTO_MOVE';
update params set param_value='1' where param_id='EGAIS_WAYBILL_VER';
update params set param_value='0' where param_id='EGAIS_FORMBMODE';
update params set param_value='' where param_id='EGAIS_HOST';
/*AVO 09/01/2020*/
update params set param_value='2' where param_id='EGAIS_ALCCODE_CHECK';
commit work;

UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Стационар ') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Лаборатории') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Диагностические службы') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'ЭСФ Казахстан') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'ЕГАИС оптовики') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Дневной стационар(ДС)') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Круглосуточный стационар(КС)') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Поликлиника') AND
      (GROUPTABLE = 'AGENTS                         ');
UPDATE GROUPS SET 
    STATUS = -1
WHERE (CAPTION = 'Пациент') AND
      (GROUPTABLE = 'AGENTS                         ');

COMMIT WORK;

/* А.О. 01032018 Для не фармы убрать
UPDATE PARAMS SET ID = -130 WHERE PARAM_ID = 'ORG_ADDRESS_DETAIL';
COMMIT WORK;

UPDATE PARAMS SET STATUS = 1 WHERE PARAM_ID = 'KAZ_ESF';
UPDATE PARAMS SET STATUS = 1 WHERE PARAM_ID = 'EGAIS';
UPDATE PARAMS SET STATUS = 1 WHERE PARAM_ID = 'ORG_ADDRESS_DETAIL';
UPDATE PARAMS SET STATUS = 1 WHERE PARAM_ID = 'INIT_SCALES';

COMMIT WORK;
*/

--очистка  egais_detail чтоб не пересекались в клонах doc_id 
delete from egais_detail;
commit work;

--Чистка G$DISTRIBUTE
alter index G$DISTRIBUTE_IDX1 inactive;
alter index G$DISTRIBUTE_IDX2 inactive;
alter index G$DISTRIBUTE_IDX3 inactive;
alter index G$DISTRIBUTE_IDX4 inactive;
alter index G$DISTRIBUTE_IDX5 inactive;
alter index G$DISTRIBUTE_IDX6 inactive;
alter index G$DISTRIBUTE_IDX7 inactive;
alter index G$DISTRIBUTE_IDX8 inactive;
alter index G$DISTRIBUTE_IDX9 inactive;
commit work;

delete from g$distribute d where coalesce(d.serverpacket,0)<(select max(g.serverpacket) from g$distribute g);
commit work;

alter index G$DISTRIBUTE_IDX1 active;
alter index G$DISTRIBUTE_IDX2 active;
alter index G$DISTRIBUTE_IDX3 active;
alter index G$DISTRIBUTE_IDX4 active;
alter index G$DISTRIBUTE_IDX5 active;
alter index G$DISTRIBUTE_IDX6 active;
alter index G$DISTRIBUTE_IDX7 active;
alter index G$DISTRIBUTE_IDX8 active;
alter index G$DISTRIBUTE_IDX9 active;

commit work;

update agents set id=id where agents.deletedt is null; -->23042019 Иначе появляются дублирующие контрагенты и не обновляется
update users set id=id;
update docs set id=id;
update sessions set id=id;

commit work;

-->20180213 
-- Чистка режима все партии 
delete from WAREBASEPARTS;
commit work;

--Включаем режим все партии
ALTER TRIGGER AGENTS_WP_AIU0 ACTIVE;
ALTER TRIGGER PARTS_WP_AIU0 ACTIVE;
ALTER TRIGGER WARES_WP_AIU0 ACTIVE;

--Добавлено в чистку 09/01/2020 AVO -->
 delete from g$distribute g where g.tablename=Upper('DOCS') and
 not exists(select id from DOCS d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('DOC_DETAIL') and
 not exists(select id from DOC_DETAIL d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('PARAMS') and
 not exists(select id from PARAMS d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('PARTS') and
 not exists(select id from PARTS d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('SESSIONS') and
 not exists(select id from SESSIONS d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('USERS') and
 not exists(select id from USERS d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('DOCS_CANCELED') and
 not exists(select id from DOCS_CANCELED d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('VALS') and
 not exists(select id from VALS d where d.d$uuid = g.uuid);
 delete from g$distribute g where g.tablename=Upper('WARES') and
 not exists(select id from WARES d where d.d$uuid = g.uuid);

commit work;
-- 09/01/2020 <--

--Сборка режима все партии
execute procedure updpr_warebaseparts(null,null,null,null);
commit work;
--20180213 <--