技术贴,久违了!
阅读本文共约 3 分钟。
对于cs架构的应用来说,客户端需要安装应用是必须的。一台机子还好说,当存在500台甚至上千台时,有没有想过要咋么去搞?
这个时候,就要从应用架构的角度去处理或者采用人为的模式去干扰。
我就想到了一个简单的批处理去执行应用,采用iis更新机制将批处理下载到客户端,直接运行安装即可。节省了拷贝应用程序的时间。这大概是好几年前的事情了。
批处理:
以安装Notepad++为例:
explorer \\192.168.1.222
e:
cd E:\工作日常-UUAPP
start Notepad++_51000001069911213935.exe
视图:
在附上一个视图,其实看起来也没有多难,当时做接口的时候写的一个lis视图。
SELECT CONVERT(varchar(100), a.ReceiveDate, 112) + a.zdy5 + a.SampleNo AS id, CONVERT(varchar(100), a.ReceiveDate, 112) + a.SampleNo AS bgdh, rtrim(cast(right('000'+ltrim(SUBSTRing(right(a.serialno,12),1,7)),10) as CHAR))
+rtrim(CAST( cast(left(a.serialno,(LEN(a.serialno)-12)) as int ) as CHAR) ) AS pat_no, '' AS sqrgg, a.DoctorName AS sqrxm, '' AS bgrgh, a.Technician AS bgrxm, '' AS shrrh, a.Checker AS shrxm, '' AS sqks,
a.DeptName AS sqksmc, b.ReceiveDate AS sqrq, CONVERT(varchar(100), a.CollectDate, 23) + ' ' + CONVERT(varchar(100), a.CollectTime, 24) AS cjsj,
CONVERT(varchar(100), a.TestDate, 23) + ' ' + CONVERT(varchar(100), a.TestTime, 24) AS jyrq, a.SampleTypeName AS bbdm,
a.SampleTypeName AS bbmc, b.ItemNo AS bgdlbbm, b.TestItemName AS bgdlb
FROM dbo.ReportFormFull AS a INNER JOIN
dbo.ReportItemView AS b ON a.ReceiveDate = b.ReceiveDate AND a.SectionNo = b.SectionNo AND a.TestTypeNo = b.TestTypeNo AND
a.SampleNo = b.SampleNo AND a.SickTypeName = 'סԺ' and Convert(nvarchar(10),a.ReceiveDate,120)>=Convert(nvarchar(10),DATEADD(day, -30, GETDATE()),120)
存储过程:
create procedure PH_DETAIL_MASTER
(
p_startdate timestamp, /*开始时间*/
p_enddate timestamp /*结束时间*/
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
--声明一个变量
DECLARE sqlstr varchar(20000);
DECLARE tran CURSOR WITH RETURN FOR s;
--创建明细账临时表
DECLARE GLOBAL TEMPORARY TABLE SESSION.D_DETAIL_A (CHARGE_DATE timestamp,DEPT_CODE varchar(50),CHARGE_KIND_CODE varchar(20),PATIENT_TYPE_CODE varchar(50),CHARGE_MONEY decimal(18,2),CHECK_NO varchar(40), PATIENT_NAME varchar(100),CHARGE_CODE varchar(40),CHARGE_NAME varchar(40),BEGIN_NO varchar(40),END_NO varchar(40),IS_BACK INT) with replace;
x1:For item as SELECT D_GATHERING_MASTER.OPERATORID,D_GATHERING_MASTER.STARTDATE,D_GATHERING_MASTER.ENDDATE
FROM D_GATHERING_MASTER where D_GATHERING_MASTER.ENDDATE BETWEEN p_startdate AND p_enddate
DO
INSERT INTO SESSION.D_DETAIL_A
SELECT T.BALANCEDATE,T.REGISTEROFFICEID,E.SUBJECTID,D.CHARGEKINDID,t.MONEY,'' check_no,B.PATIENTNAME,T.OPERATORID,C.OPERATORNAME,T.INVOICEID,T.INVOICEID,T.CANCELMARK
FROM D_DETAIL_ACCOUNT T ,T_PATIENT_INFO B,T_OPERATOR C,S_CHARGE_KIND D ,D_SUMMARY_INFO E
WHERE T.DIAGNOSEID=B.DIAGNOSEID AND T.OPERATORID=C.OPERATORID AND T.SICKTYPEID=D.CHARGEKINDID
AND T.ITEMID=e.ITEMID
AND T.BALANCEDATE BETWEEN item.STARTDATE AND item.ENDDATE AND T.BALANCEOPERATOR=item.OPERATORID
UNION all
SELECT TR.OPERATEDATE,TR.REGISTEROFFICEID, '0079' AS SUBJECTID,'0001' AS CHARGEKINDID,
(TR.REGISTERFEE+TR.EXAMINEMONEY+TR.CASECOST+TR.CHECKFEE) AS MONEY,'' check_no,TP.PATIENTNAME,TR.BALANCEOPERATOR,C.OPERATORNAME,TR.INVOICEID,TR.INVOICEID,TR.CANCELMARK
FROM T_REGISTER_INFO TR,T_PATIENT_INFO TP,T_OPERATOR C
WHERE TR.DIAGNOSEID=TP.DIAGNOSEID AND TR.BALANCEOPERATOR=C.OPERATORID
AND TR.BALANCEDATE BETWEEN item.STARTDATE AND item.ENDDATE AND TR.BALANCEOPERATOR=item.OPERATORID;
end for x1;
SET sqlstr = 'select * FROM SESSION.D_DETAIL_A';
prepare s from sqlstr;
OPEN tran;
END
;
待续中......
往期文章:
懂业务的技术人!
待续中。