Index: ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/配置一级供应室的器械包及服务临床脚本_oracle.sql =================================================================== diff -u --- ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/配置一级供应室的器械包及服务临床脚本_oracle.sql (revision 0) +++ ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/配置一级供应室的器械包及服务临床脚本_oracle.sql (revision 13239) @@ -0,0 +1,57 @@ +declare + cssdCode varchar(100); + cssdName varchar(100); +begin + + select orgUnitCoding into cssdCode from SupplyRoomConfig where supplyRoomType='1'; + select orgUnitName into cssdName from SupplyRoomConfig where supplyRoomType='1'; + + if cssdCode is null then + begin + dbms_output.put_line('δ����һ����Ӧ��,��������һ����Ӧ��'); + end; + else + begin + dbms_output.put_line('һ����Ӧ�ұ���='||cssdCode||',����='||cssdName); + + insert into CssdHandleTousses (id, + orgUnitCode + ,orgUnitName + ,tousseDefinitionId + ,tousseName + ) + select HIBERNATE_SEQUENCE.Nextval, cssdCode,cssdName,td.id,td.name from TousseDefinition td where td.forDisplay='1' + and td.id not in (select tousseDefinitionId from CssdHandleTousses); + + + insert into CssdServiceDepts(id,clinicOrgUnitCode + ,clinicOrgUnitId + ,clinicOrgUnitName + ,cssdOrgUnitCode + ,cssdOrgUnitName + ,tousseType) + select HIBERNATE_SEQUENCE.Nextval,ou.orgUnitCoding,ou.id,ou.name,cssdCode,cssdName,'��е��' from OrgUnit ou + where ou.orgUnitCoding in (select orgUnitCoding from SupplyRoomConfig where supplyRoomType in ('3','4')) + and ou.orgUnitCoding not in (select clinicOrgUnitCode from CssdServiceDepts where tousseType='��е��'); + + + + insert into CssdServiceDepts(id,clinicOrgUnitCode + ,clinicOrgUnitId + ,clinicOrgUnitName + ,cssdOrgUnitCode + ,cssdOrgUnitName + ,tousseType) + select HIBERNATE_SEQUENCE.Nextval,ou.orgUnitCoding,ou.id,ou.name,cssdCode,cssdName,'һ������Ʒ' from OrgUnit ou + where ou.orgUnitCoding in (select orgUnitCoding from SupplyRoomConfig where supplyRoomType in ('3','4')) + and ou.orgUnitCoding not in (select clinicOrgUnitCode from CssdServiceDepts where tousseType='һ������Ʒ'); + dbms_output.put_line('ִ�гɹ�'); + commit; + + + end; + + end if; + +end; + Index: ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/配置一级供应室的器械包及服务临床脚本_sqlserver.sql =================================================================== diff -u --- ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/配置一级供应室的器械包及服务临床脚本_sqlserver.sql (revision 0) +++ ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/配置一级供应室的器械包及服务临床脚本_sqlserver.sql (revision 13239) @@ -0,0 +1,54 @@ +declare @cssdCode varchar(100) = null,@cssdName varchar(100) = null; +select @cssdCode=orgUnitCoding,@cssdName=orgUnitName from SupplyRoomConfig where supplyRoomType='1' +if(@cssdCode is null) +begin +print 'δ����һ����Ӧ��,��������һ����Ӧ��' +end +else +begin +print 'һ����Ӧ�ұ���='+@cssdCode + ',����=' + @cssdName +begin tran +begin try + +insert into CssdHandleTousses ( +[orgUnitCode] + ,[orgUnitName] + ,[tousseDefinitionId] + ,[tousseName] +) +select @cssdCode,@cssdName,td.id,td.name from TousseDefinition td where td.forDisplay='1' +and td.id not in (select tousseDefinitionId from CssdHandleTousses) + + +insert into CssdServiceDepts([clinicOrgUnitCode] + ,[clinicOrgUnitId] + ,[clinicOrgUnitName] + ,[cssdOrgUnitCode] + ,[cssdOrgUnitName] + ,[tousseType]) +select ou.orgUnitCoding,ou.id,ou.name,@cssdCode,@cssdName,'��е��' from OrgUnit ou +where ou.orgUnitCoding in (select orgUnitCoding from SupplyRoomConfig where supplyRoomType in ('3','4')) +and ou.orgUnitCoding not in (select clinicOrgUnitCode from CssdServiceDepts where [tousseType]='��е��') + + + + +insert into CssdServiceDepts([clinicOrgUnitCode] + ,[clinicOrgUnitId] + ,[clinicOrgUnitName] + ,[cssdOrgUnitCode] + ,[cssdOrgUnitName] + ,[tousseType]) +select ou.orgUnitCoding,ou.id,ou.name,@cssdCode,@cssdName,'һ������Ʒ' from OrgUnit ou +where ou.orgUnitCoding in (select orgUnitCoding from SupplyRoomConfig where supplyRoomType in ('3','4')) +and ou.orgUnitCoding not in (select clinicOrgUnitCode from CssdServiceDepts where [tousseType]='һ������Ʒ') +print 'ִ�гɹ�' +commit tran +end try + +begin catch +rollback tran +print 'ִ��ʧ��,�����ѻع�' +end catch +end + Index: ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/服务器启动之后执行的脚本.txt =================================================================== diff -u -r13237 -r13239 --- ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/服务器启动之后执行的脚本.txt (.../服务器启动之后执行的脚本.txt) (revision 13237) +++ ssts-web/src/main/webapp/dataUpdater/4.0升级4.1脚本/服务器启动之后执行的脚本.txt (.../服务器启动之后执行的脚本.txt) (revision 13239) @@ -2,7 +2,7 @@ /* �ȷ�������4.1����������֮����ִ�д������ű� */ /* һ������Ʒ��� */ -/* ��Ҫ���ö�Ӧ�IJֿ⣬Ȼ��'��Ժ�ֿ�'�滻Ϊ���õIJֿ��� */ +/* ��Ҫ���ö�Ӧ�IJֿ⣬Ȼ��'��Ժ��Ӧ�Ҳֿ�'�滻Ϊ���õIJֿ��� */ delete from IdentificationOfDisposableGoods; delete from DisposableGoodsBatchStock; delete from DisposableGoodsStock; @@ -19,8 +19,8 @@ insert into DisposableGoodsStock (id,amount,certification,externalCode,guid,inventorySerialNumber,isApplicationMaterial,isPartOfTousseMaterial,isSupplyRoomGoods,maxStorage,minApplyAmount,minStorage,name,packageSpec,referencePrice,specification,spelling,type,unit,unitConvertCoefficient,wbCode) (select id,amount,certification,externalCode,guid,inventorySerialNumber,isApplicationMaterial,isPartOfTousseMaterial,isSupplyRoomGoods,maxStorage,minApplyAmount,minStorage,name,packageSpec,referencePrice,specification,spelling,type,unit,unitConvertCoefficient,wbCode from DiposableGoods) set identity_insert DisposableGoodsStock off update DisposableGoodsStock set disposableGoodsID=id; -update DisposableGoodsStock set warehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update DisposableGoodsStock set warehouseName='��Ժ�ֿ�'; +update DisposableGoodsStock set warehouseID=(select id from WareHouse where name='��Ժ��Ӧ�Ҳֿ�'); +update DisposableGoodsStock set warehouseName='��Ժ��Ӧ�Ҳֿ�'; /* ����һ������Ʒ���ζ���*/ insert into DisposableGoodsBatch (id,batchNumber,cost,expDate,manufacturer,sterileBatchNumber,storage,supplierName,diposablegoods_id,producingArea) (select d.id,d.batchNumber,d.cost,d.expDate,d.manufacturer,d.sterileBatchNumber,d.storage,d.supplierName,d.diposablegoods_id,d.producingArea from DiposableGoodBatchStock d inner join BarcodeDevice b on d.id=b.id) @@ -31,8 +31,8 @@ set identity_insert DisposableGoodsBatchStock off update DisposableGoodsBatchStock set disposableGoodsID=diposablegoods_id; update DisposableGoodsBatchStock set disposableGoodsBatchID=id; -update DisposableGoodsBatchStock set warehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update DisposableGoodsBatchStock set warehouseName='��Ժ�ֿ�'; +update DisposableGoodsBatchStock set warehouseID=(select id from WareHouse where name='��Ժ��Ӧ�Ҳֿ�'); +update DisposableGoodsBatchStock set warehouseName='��Ժ��Ӧ�Ҳֿ�'; /* IdentificationOfDiposableGoods ����Ϊ IdentificationOfDisposableGoods */ delete from IdentificationOfDisposableGoods; @@ -42,46 +42,28 @@ update IdentificationOfDisposableGoods set disposableGoodsID=(select TOP 1 diposablegoods_id from DiposableGoodBatchStock where id=batch_id); update IdentificationOfDisposableGoods set disposableGoodsStockID=batch_id; update IdentificationOfDisposableGoods set disposableGoodsBatchID=batch_id; -update IdentificationOfDisposableGoods set warehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update IdentificationOfDisposableGoods set warehouseName='��Ժ�ֿ�'; +update IdentificationOfDisposableGoods set warehouseID=(select id from WareHouse where name='��Ժ��Ӧ�Ҳֿ�'); +update IdentificationOfDisposableGoods set warehouseName='��Ժ��Ӧ�Ҳֿ�'; /* ������ⵥ�IJֿ���Ϣ */ -update GodownEntry set wareHouseId=(select id from WareHouse where name='��Ժ�ֿ�'); -update GodownEntry set wareHouseName='��Ժ�ֿ�'; +update GodownEntry set wareHouseId=(select id from WareHouse where name='��Ժ��Ӧ�Ҳֿ�'); +update GodownEntry set wareHouseName='��Ժ��Ӧ�Ҳֿ�'; /* ������ⵥ��ϸ��һ������Ʒ��Ϣ */ update GodownEntryItem set disposableGoodsID=diposableGoodsID,disposableGoodsStockID=diposableGoodsID,disposableGoodsBatchID=batchID,disposableGoodsBatchStockID=batchID; /* ������ⵥ��ϸ�IJֿ���Ϣ */ -update GodownEntryItem set wareHouseId=(select id from WareHouse where name='��Ժ�ֿ�'); -update GodownEntryItem set wareHouseName='��Ժ�ֿ�'; +update GodownEntryItem set wareHouseId=(select id from WareHouse where name='��Ժ��Ӧ�Ҳֿ�'); +update GodownEntryItem set wareHouseName='��Ժ��Ӧ�Ҳֿ�'; /* ������ⵥһ������Ʒ��ϸ��һ������Ʒ��Ϣ */ update GodownEntryDiposableGoodsItem set disposableGoodsID=diposableGoodsID,disposableGoodsStockID=diposableGoodsID,disposableGoodsBatchID=batchID,disposableGoodsBatchStockID=batchID; -/* �����̵��¼�IJֿ���Ϣ */ -update StockTakeInfo set warehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update StockTakeInfo set warehouseName='��Ժ�ֿ�'; /* �����̵��¼��ϸ��һ������Ʒ��Ϣ */ update StockTakeItem set disposableGoodsId=diposableGoodsID,disposableGoodsStockId=diposableGoodsID,disposableGoodsBatchId=batchID,disposableGoodsBatchStockId=batchID; -/* �����̵��¼��ϸ�IJֿ���Ϣ */ -update StockTakeItem set wareHouseId=(select id from WareHouse where name='��Ժ�ֿ�'); -update StockTakeItem set wareHouseName='��Ժ�ֿ�'; -/* ���÷������IJֿ���Ϣ */ -update Invoice set warehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update Invoice set warehouseName='��Ժ�ֿ�'; -update Invoice set sourceWarehouseId=(select id from WareHouse where name='��Ժ�ֿ�'); -update Invoice set sourceWarehouseName='��Ժ�ֿ�'; -/* ���÷�������ϸ�IJֿ���Ϣ */ -update InvoiceItem set wareHouseId=(select id from WareHouse where name='��Ժ�ֿ�'); -update InvoiceItem set wareHouseName='��Ժ�ֿ�'; /* ���÷�����һ������Ʒ��ϸ��һ������Ʒ��Ϣ */ update DiposableGoodsItem set disposableGoodsId=diposableGoodsID,disposableGoodsStockId=diposableGoodsID,disposableGoodsBatchId=batchID,disposableGoodsBatchStockId=batchID; -/* �����˻���¼�IJֿ���Ϣ */ -update ReturnGoodsRecord set warehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update ReturnGoodsRecord set warehouseName='��Ժ�ֿ�'; -update ReturnGoodsRecord set srcWarehouseID=(select id from WareHouse where name='��Ժ�ֿ�'); -update ReturnGoodsRecord set srcWarehouseName='��Ժ�ֿ�'; + /* �����˻���¼��ϸ��һ������Ʒ��Ϣ */ update ReturnGoodsItem set disposableGoodsId=diposableGoodsID,disposableGoodsStockId=diposableGoodsID,disposableGoodsBatchId=batchID,disposableGoodsBatchStockId=batchID;