/// <summary> /// 查询 /// </summary> private void Query() { this.ucRegDayBalanceReport1.InitUC(); if (this.treeView1.SelectedNode.Parent == null) { MessageBox.Show("请选择操作员!", "提示"); return; } frmQueryDayReport f = new frmQueryDayReport(); f.OperID = this.treeView1.SelectedNode.Tag.ToString(); f.Query(); DialogResult r = f.ShowDialog(); if (r == DialogResult.OK) { this.objDayReport = f.SelectedDayReport; if (this.objDayReport != null && this.objDayReport.ID != "") { ArrayList aldetails = this.dayReport.Query(this.objDayReport.ID); foreach (Neusoft.HISFC.Models.Registration.DayDetail obj in aldetails) { this.objDayReport.Details.Add(obj); } //this.SetCR(); this.ShowReport(); this.ucRegDayBalanceReport1.setFP(this.objDayReport); } } f.Dispose(); this.RepeatFlag = true; }
/// <summary> /// 查询日结信息 /// </summary> /// <param name="OperId"></param> /// <param name="begin"></param> /// <param name="end"></param> /// <returns></returns> public ArrayList Query(string OperId, DateTime begin, DateTime end) { string sql = ""; if (this.Sql.GetSql("Registration.DayReport.Query.2", ref sql) == -1) { return(null); } try { sql = string.Format(sql, OperId, begin.ToString(), end.ToString()); } catch (Exception e) { this.Err = "查询日结信息时出错![Registration.DayReport.Query.2]" + e.Message; this.ErrCode = e.Message; return(null); } if (this.ExecQuery(sql) == -1) { return(null); } ArrayList al = new ArrayList(); try { while (this.Reader.Read()) { Neusoft.HISFC.Models.Registration.DayReport report = new Neusoft.HISFC.Models.Registration.DayReport(); report.ID = this.Reader[2].ToString(); report.BeginDate = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[3].ToString()); report.EndDate = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[4].ToString()); report.SumCount = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader[5].ToString()); report.SumRegFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[6].ToString()); report.SumChkFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[7].ToString()); report.SumDigFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[8].ToString()); report.SumOthFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[9].ToString()); report.SumOwnCost = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[10].ToString()); report.SumPayCost = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[11].ToString()); report.SumPubCost = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[12].ToString()); report.Oper.ID = this.Reader[13].ToString(); report.Oper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[14].ToString()); al.Add(report); } this.Reader.Close(); } catch (Exception e) { this.Err = "查询日结信息时出错![Registration.DayReport.Query.2]" + e.Message; this.ErrCode = e.Message; return(null); } return(al); }
/// <summary> /// 登记日结信息 /// </summary> /// <param name="dayReport"></param> /// <returns></returns> public int Insert(Neusoft.HISFC.Models.Registration.DayReport dayReport) { string sql = ""; if (this.Sql.GetSql("Registration.DayReport.Insert.1", ref sql) == -1) { return(-1); } try { sql = string.Format(sql, dayReport.ID, dayReport.BeginDate.ToString(), dayReport.EndDate.ToString(), dayReport.SumCount, dayReport.SumRegFee, dayReport.SumChkFee, dayReport.SumDigFee, dayReport.SumOthFee, dayReport.SumOwnCost, dayReport.SumPayCost, dayReport.SumPubCost, dayReport.Oper.ID, dayReport.Oper.OperTime.ToString()); } catch (Exception e) { this.Err = "[Registration.DayReport.Insert.1]格式不匹配!" + e.Message; this.ErrCode = e.Message; return(-1); } if (this.ExecNoQuery(sql) == -1) { return(-1); } foreach (Neusoft.HISFC.Models.Registration.DayDetail detail in dayReport.Details) { if (this.Insert(detail) == -1) { return(-1); } } return(0); }
/// <summary> /// 将信息填充到farpoint上 /// </summary> /// <param name="dayreport">挂号日结实体</param> /// <returns></returns> public int setFP(Neusoft.HISFC.Models.Registration.DayReport dayreport) { int BackCount = 0; //退费张数 int Disvalid = 0; //作废张数 //this.lblDayDate.Text = dayreport.BeginDate.ToString() + "----" + dayreport.EndDate.ToString(); if (dayreport.Details.Count <= 0) { return(-1); } for (int i = 0; i < dayreport.Details.Count; i++) { this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1); this.neuSpread1_Sheet1.Cells[i, 0].Text = dayreport.Details[i].BeginRecipeNo + "~" + dayreport.Details[i].EndRecipeNo; this.neuSpread1_Sheet1.Cells[i, 1].Text = dayreport.Details[i].Count.ToString(); if (dayreport.Details[i].Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Back) { #region {3E1E803B-426C-4db6-9E28-C910544CC8B8} liuq 因为挂号退号存记录的方式变了,日结需要做相应变动 //this.neuSpread1_Sheet1.Cells[i, 2].Text = (-dayreport.Details[i].OwnCost).ToString(); //this.neuSpread1_Sheet1.Cells[i, 3].Text = (-dayreport.Details[i].PayCost).ToString(); //this.neuSpread1_Sheet1.Cells[i, 4].Text = (-dayreport.Details[i].RegFee).ToString(); //this.neuSpread1_Sheet1.Cells[i, 5].Text = (-dayreport.Details[i].DigFee - dayreport.Details[i].ChkFee).ToString(); //this.neuSpread1_Sheet1.Cells[i, 6].Text = (-dayreport.Details[i].OthFee).ToString(); //BackCount += dayreport.Details[i].Count; this.neuSpread1_Sheet1.Cells[i, 2].Text = (dayreport.Details[i].OwnCost).ToString(); this.neuSpread1_Sheet1.Cells[i, 3].Text = (dayreport.Details[i].PayCost).ToString(); this.neuSpread1_Sheet1.Cells[i, 4].Text = (dayreport.Details[i].RegFee).ToString(); this.neuSpread1_Sheet1.Cells[i, 5].Text = (dayreport.Details[i].DigFee - dayreport.Details[i].ChkFee).ToString(); this.neuSpread1_Sheet1.Cells[i, 6].Text = (dayreport.Details[i].OthFee).ToString(); BackCount += dayreport.Details[i].Count; #endregion } else { this.neuSpread1_Sheet1.Cells[i, 2].Text = dayreport.Details[i].OwnCost.ToString(); this.neuSpread1_Sheet1.Cells[i, 3].Text = (dayreport.Details[i].PayCost).ToString(); this.neuSpread1_Sheet1.Cells[i, 4].Text = dayreport.Details[i].RegFee.ToString(); this.neuSpread1_Sheet1.Cells[i, 5].Text = (dayreport.Details[i].DigFee + dayreport.Details[i].ChkFee).ToString(); this.neuSpread1_Sheet1.Cells[i, 6].Text = dayreport.Details[i].OthFee.ToString(); } this.neuSpread1_Sheet1.Cells[i, 7].Text = getStatus(dayreport.Details[i].Status); if (dayreport.Details[i].Status == Neusoft.HISFC.Models.Base.EnumRegisterStatus.Cancel) { Disvalid += dayreport.Details[i].Count; } } //合计 this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].Text = "合计"; this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 1].Text = dayreport.SumCount.ToString(); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 2].Text = dayreport.SumOwnCost.ToString(); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 3].Text = dayreport.SumPayCost.ToString(); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 4].Text = dayreport.SumRegFee.ToString(); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 5].Text = (dayreport.SumDigFee + dayreport.SumChkFee).ToString(); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 6].Text = dayreport.SumOthFee.ToString(); //大写金额 this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1); this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 0, 1, 8); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].Text = "实收金额(大写): " + Neusoft.FrameWork.Function.NConvert.ToCapital(dayreport.SumOwnCost); // 操作员信息 this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1); this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 0, 1, 2); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].Text = "缴款人: " + dayreport.Oper.Name; this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 2, 1, 3); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 2].Text = "收款员: " + dayreport.Oper.ID; this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 5, 1, 3); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 5].Text = "作废张数: " + Disvalid.ToString(); // this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1); this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 0, 1, 2); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].Text = "填表人: "; this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 2, 1, 3); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 2].Text = "出纳员: "; this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 5, 1, 3); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 5].Text = "退费张数:" + BackCount.ToString(); this.neuSpread1_Sheet1.AddRows(this.neuSpread1_Sheet1.RowCount, 1); this.neuSpread1_Sheet1.Models.Span.Add(this.neuSpread1_Sheet1.RowCount - 1, 0, 1, 8); this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.RowCount - 1, 0].Text = "统计时间: " + dayreport.BeginDate.ToString() + "---" + dayreport.EndDate.ToString(); return(1); }
/// <summary> /// 生成日结明细实体 /// </summary> /// <param name="begin"></param> /// <param name="end"></param> /// <param name="operID"></param> /// <param name="operName"></param> private void SetReportDetail(DateTime begin, DateTime end, string operID, string operName) { DateTime current = this.regMgr.GetDateTimeFromSysDateTime(); this.objDayReport = new Neusoft.HISFC.Models.Registration.DayReport(); this.objDayReport.BeginDate = begin; this.objDayReport.EndDate = end; this.objDayReport.Oper.ID = operID; this.objDayReport.Oper.Name = operName; this.objDayReport.Oper.OperTime = current; Neusoft.HISFC.Models.Registration.DayDetail detail = new Neusoft.HISFC.Models.Registration.DayDetail(); detail.EndRecipeNo = "-1"; //生成日报实体,原则:连续处方、处方状态一致的合为一条日结明细 for (int i = 0; i < this.dsRegInfo.Tables[0].Rows.Count; i++) { DataRow row = this.dsRegInfo.Tables[0].Rows[i]; ///挂号状态为退号、日结人不是作废人、未日结,此种情况为别人退该操作员号,此号有效 /// if (row[8].ToString() == "0" && operID != row[9].ToString()) { row[8] = "1";//置为有效 } if (long.Parse(row[0].ToString()) - 1 != long.Parse(detail.EndRecipeNo) || //处方不连续 int.Parse(row[8].ToString()) != (int)detail.Status) //状态改变 { //生成新的日结明细 if (i != 0)//第一条不处理 { this.objDayReport.Details.Add(detail); } //重新生成新的明细 detail = new Neusoft.HISFC.Models.Registration.DayDetail(); detail.BeginRecipeNo = row[0].ToString(); //开始号 detail.EndRecipeNo = detail.BeginRecipeNo; //Convert.ToString(long.Parse(row[0].ToString()) -1) ; detail.Status = (Neusoft.HISFC.Models.Base.EnumRegisterStatus) int.Parse(row[8].ToString()); } detail.EndRecipeNo = row[0].ToString(); detail.Count++; detail.RegFee += decimal.Parse(row[1].ToString()); detail.ChkFee += decimal.Parse(row[2].ToString()); detail.DigFee += decimal.Parse(row[3].ToString()); detail.OthFee += decimal.Parse(row[4].ToString()); detail.OwnCost += decimal.Parse(row[5].ToString()); detail.PayCost += decimal.Parse(row[6].ToString()); detail.PubCost += decimal.Parse(row[7].ToString()); if (i == this.dsRegInfo.Tables[0].Rows.Count - 1) { this.objDayReport.Details.Add(detail);//最后一条也重新生成明细 } } }
/// <summary> /// 清屏 /// </summary> private void Clear() { //this.source.Tables[0].Rows.Clear(); this.objDayReport = null; this.ShowReport(); }