769 lines
33 KiB
C#
769 lines
33 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using SOH.Kernel;
|
|
using SOH.BLL;
|
|
using SOH.Entities;
|
|
using EAS;
|
|
using EAS.Data;
|
|
using EAS.Services;
|
|
using SOH.Data;
|
|
using SOH.Entities.DTO;
|
|
using WinForm_Test;
|
|
|
|
namespace SOH.KeFu
|
|
{
|
|
[ModuleAttribute(ModuleID = "0F71A7AA-DED8-4A02-AA51-1B8D6B5FA7A5", ModuleName = "每日工作量统计")]
|
|
public partial class frmMeiRiGongZuoLiangTongJi : SOH.Window.baseChildForm
|
|
{
|
|
private short fddm;
|
|
private List<t_grgzb> lt_grgzbs;
|
|
private List<t_ttgzb> lt_ttgzbs;
|
|
public frmMeiRiGongZuoLiangTongJi()
|
|
{
|
|
InitializeComponent();
|
|
string yydm = LoginUser.yydm;
|
|
short fddmtemp = 0;
|
|
short.TryParse(yydm, out fddmtemp);
|
|
fddm = fddmtemp;
|
|
this.dataGridView1.AutoGenerateColumns = false;
|
|
this.dataGridView2.AutoGenerateColumns = false;
|
|
}
|
|
|
|
public Boolean chackRq(DateTime dt, DateTime dt1)
|
|
{
|
|
Boolean b = true;
|
|
int compNum = DateTime.Compare(dt, dt1);
|
|
|
|
|
|
if (compNum > 0)
|
|
{
|
|
MessageBox.Show("开始时间不能大于结束时间");
|
|
b = false;
|
|
}
|
|
|
|
TimeSpan ts = dt1 - dt;
|
|
|
|
if (ts.Days > 365)
|
|
{
|
|
MessageBox.Show("查询时间不能超过1年");
|
|
b = false;
|
|
}
|
|
return b;
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
DateTime dt = DateTime.Parse(this.dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
DateTime dt1 = DateTime.Parse(this.dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
|
if (!chackRq(dt, dt1))
|
|
{
|
|
return;
|
|
}
|
|
|
|
var vs = ServiceContainer.GetService<It_grgzb>();
|
|
List<t_grgzb> lt_grgzb = vs.GetGrgzb(fddm, dt, dt1);
|
|
|
|
List<t_ttgzb> lt_ttgzb = vs.GetTtgzb(fddm, dt, dt1);
|
|
|
|
DataTable dt_lsjx = vs.GetLsjx(dt, dt1);
|
|
|
|
DataTable dt_hyxm = vs.GetHyxm(dt, dt1);
|
|
|
|
DataTable dt_qtxm = vs.GetQtxm(dt, dt1);
|
|
|
|
var vservice = ServiceContainer.GetService<It_ttgzb>();
|
|
String data = vservice.selectBgcjl(dt, dt1, fddm);
|
|
DataTable dt_bgcjl = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|
|
|
//2021年2月26日 淄博增加的统计需求
|
|
DataTable dt_yzbm = vs.GetYzbm(dt, dt1);
|
|
|
|
//医生工作量
|
|
DataTable dt_xmzs = vs.GetXmzs(dt, dt1);
|
|
|
|
//页面数据缓存
|
|
lt_grgzbs = lt_grgzb;
|
|
lt_ttgzbs = lt_ttgzb;
|
|
|
|
this.dataGridView2.DataSource = null;
|
|
|
|
|
|
List<dto_gzltj> lds = new List<dto_gzltj>();
|
|
dto_gzltj ds1 = new dto_gzltj();
|
|
ds1.lx = 0;
|
|
ds1.flmc = "个检";
|
|
ds1.rs = lt_grgzb != null ? lt_grgzb.Count : 0;
|
|
lds.Add(ds1);
|
|
|
|
dto_gzltj ds2 = new dto_gzltj();
|
|
ds2.lx = 1;
|
|
ds2.flmc = "团检";
|
|
ds2.rs = lt_ttgzb != null ? lt_ttgzb.Count : 0;
|
|
lds.Add(ds2);
|
|
|
|
dto_gzltj ds3 = new dto_gzltj();
|
|
ds3.lx = 2;
|
|
ds3.flmc = "加项";
|
|
ds3.rs = dt_lsjx.Rows.Count != 0 ? dt_lsjx.Rows.Count : 0;
|
|
lds.Add(ds3);
|
|
|
|
/*dto_gzltj ds4 = new dto_gzltj();
|
|
ds4.lx = 3;
|
|
ds4.flmc = "检验项目";
|
|
ds4.rs = dt_hyxm.Rows.Count != 0 ? dt_hyxm.Rows.Count : 0;
|
|
lds.Add(ds4);*/
|
|
|
|
dto_gzltj ds5 = new dto_gzltj();
|
|
ds5.lx = 4;
|
|
ds5.flmc = "其他项目";
|
|
ds5.rs = dt_qtxm.Rows.Count != 0 ? dt_qtxm.Rows.Count : 0;
|
|
lds.Add(ds5);
|
|
|
|
//淄博后期增加的统计项目
|
|
dto_gzltj ds6 = new dto_gzltj();
|
|
ds6.lx = 5;
|
|
ds6.flmc = "人工体检人次";
|
|
ds6.rs = GetRs(dt_yzbm, "人工体检人次");
|
|
lds.Add(ds6);
|
|
|
|
dto_gzltj ds7 = new dto_gzltj();
|
|
ds7.lx = 5;
|
|
ds7.flmc = "彩超部位";
|
|
ds7.rs = GetRs(dt_yzbm, "彩超部位");
|
|
lds.Add(ds7);
|
|
|
|
dto_gzltj ds8 = new dto_gzltj();
|
|
ds8.lx = 5;
|
|
ds8.flmc = "DR检查";
|
|
ds8.rs = GetRs(dt_yzbm, "DR检查");
|
|
lds.Add(ds8);
|
|
|
|
dto_gzltj ds9 = new dto_gzltj();
|
|
ds9.lx = 5;
|
|
ds9.flmc = "CT检查";
|
|
ds9.rs = GetRs(dt_yzbm, "CT检查");
|
|
lds.Add(ds9);
|
|
|
|
dto_gzltj ds10 = new dto_gzltj();
|
|
ds10.lx = 5;
|
|
ds10.flmc = "项目检查";
|
|
ds10.rs = GetRs(dt_yzbm, "项目检查");
|
|
lds.Add(ds10);
|
|
|
|
dto_gzltj ds11 = new dto_gzltj();
|
|
ds11.lx = 5;
|
|
ds11.flmc = "检验项目";
|
|
ds11.rs = GetRs(dt_yzbm, "检验项目");
|
|
lds.Add(ds11);
|
|
|
|
dto_gzltj ds12 = new dto_gzltj();
|
|
ds12.lx = 5;
|
|
ds12.flmc = "基因检测";
|
|
ds12.rs = GetRs(dt_yzbm, "基因检测");
|
|
lds.Add(ds12);
|
|
|
|
dto_gzltj ds13 = new dto_gzltj();
|
|
ds13.lx = 5;
|
|
ds13.flmc = "外送项目";
|
|
ds13.rs = GetRs(dt_yzbm, "外送项目");
|
|
lds.Add(ds13);
|
|
|
|
dto_gzltj ds14 = new dto_gzltj();
|
|
ds14.lx = 6;
|
|
ds14.flmc = "医生工作量";
|
|
ds14.rs = dt_xmzs.Rows.Count != 0 ? dt_xmzs.Rows.Count : 0;
|
|
lds.Add(ds14);
|
|
|
|
dto_gzltj ds15 = new dto_gzltj();
|
|
ds15.lx = 7;
|
|
ds15.flmc = "报告出具率";
|
|
ds15.rs = dt_bgcjl.Rows.Count != 0 ? dt_bgcjl.Rows.Count : 0;
|
|
lds.Add(ds15);
|
|
|
|
|
|
|
|
this.dataGridView1.DataSource = null;
|
|
this.dataGridView1.DataSource = lds;
|
|
|
|
}
|
|
|
|
public int GetRs(DataTable dt, string yzbm)
|
|
{
|
|
if (dt.Rows.Count == 0)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
DataRow[] dr = dt.Select("yzbm='" + yzbm + "'");
|
|
|
|
if (dr == null || dr.Length == 0)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
return int.Parse(dr[0]["rs"].ToString());
|
|
}
|
|
|
|
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
|
|
{
|
|
if (this.dataGridView1.SelectedRows.Count > 0)
|
|
{
|
|
DateTime dt = DateTime.Parse(this.dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
DateTime dt1 = DateTime.Parse(this.dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
|
if (!chackRq(dt, dt1))
|
|
{
|
|
return;
|
|
}
|
|
|
|
int rindex = this.dataGridView1.SelectedRows[0].Index;
|
|
dto_gzltj ds = this.dataGridView1.Rows[rindex].DataBoundItem as dto_gzltj;
|
|
this.dataGridView2.DataSource = null;
|
|
if (ds.lx == 0) //个人
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
if (lt_grgzbs == null || lt_grgzbs.Count == 0)
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
int gjnan = lt_grgzbs.Where(t => t.xb == 0).Count();
|
|
int gjnv = lt_grgzbs.Count() - gjnan;
|
|
double proportionMan = Convert.ToDouble(gjnan) / Convert.ToDouble(lt_grgzbs.Count()) * 100;
|
|
|
|
if (LoginUser.yydm == "1")
|
|
{
|
|
foreach (t_grgzb g in lt_grgzbs)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = g.xm;
|
|
dsl.tm = g.tm;
|
|
dsl.sl = 0;
|
|
dsl.xmmc = "";
|
|
|
|
dsl.man = gjnan;
|
|
dsl.woman = gjnv;
|
|
dsl.proportionMan = proportionMan.ToString("F2") + "%";
|
|
dsl.proportionWoman = (100 - proportionMan).ToString("F2") + "%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = true;
|
|
this.dataGridView2.Columns[1].Visible = true;
|
|
this.dataGridView2.Columns[2].Visible = false;
|
|
this.dataGridView2.Columns[3].Visible = false;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = true;
|
|
this.dataGridView2.Columns[6].Visible = true;
|
|
this.dataGridView2.Columns[7].Visible = true;
|
|
this.dataGridView2.Columns[8].Visible = true;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
foreach (t_grgzb g in lt_grgzbs)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = g.xm;
|
|
dsl.tm = g.tm;
|
|
dsl.sl = 0;
|
|
dsl.xmmc = "";
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = true;
|
|
this.dataGridView2.Columns[1].Visible = true;
|
|
this.dataGridView2.Columns[2].Visible = false;
|
|
this.dataGridView2.Columns[3].Visible = false;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else if (ds.lx == 1) //团检
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
if (lt_ttgzbs == null || lt_ttgzbs.Count == 0)
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
int tjnan = lt_ttgzbs.Where(t => t.xb == 0).Count();
|
|
int tjnv = lt_ttgzbs.Count() - tjnan;
|
|
double proportionMan = Convert.ToDouble(tjnan) / Convert.ToDouble(lt_ttgzbs.Count()) * 100;
|
|
|
|
if (LoginUser.yydm == "1")
|
|
{
|
|
foreach (t_ttgzb t in lt_ttgzbs)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = t.xm;
|
|
dsl.tm = t.tm;
|
|
dsl.sl = 0;
|
|
dsl.xmmc = "";
|
|
|
|
dsl.man = tjnan;
|
|
dsl.woman = tjnv;
|
|
dsl.proportionMan = proportionMan.ToString("F2") + "%";
|
|
dsl.proportionWoman = (100 - proportionMan).ToString("F2") + "%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = true;
|
|
this.dataGridView2.Columns[1].Visible = true;
|
|
this.dataGridView2.Columns[2].Visible = false;
|
|
this.dataGridView2.Columns[3].Visible = false;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = true;
|
|
this.dataGridView2.Columns[6].Visible = true;
|
|
this.dataGridView2.Columns[7].Visible = true;
|
|
this.dataGridView2.Columns[8].Visible = true;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
foreach (t_ttgzb t in lt_ttgzbs)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = t.xm;
|
|
dsl.tm = t.tm;
|
|
dsl.sl = 0;
|
|
dsl.xmmc = "";
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = true;
|
|
this.dataGridView2.Columns[1].Visible = true;
|
|
this.dataGridView2.Columns[2].Visible = false;
|
|
this.dataGridView2.Columns[3].Visible = false;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else if (ds.lx == 2) //加项
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
var vs = ServiceContainer.GetService<It_grgzb>();
|
|
|
|
DataTable dt_lsjx_mx = vs.GetLsjxMx(dt, dt1);
|
|
if (dt_lsjx_mx.Rows.Count != 0)
|
|
{
|
|
foreach (DataRow r in dt_lsjx_mx.Rows)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = "";
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = false;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
}
|
|
else if (ds.lx == 3) //化验项目
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
var vs = ServiceContainer.GetService<It_grgzb>();
|
|
|
|
DataTable dt_hyxm_mx = vs.GetHyxmMx(dt, dt1);
|
|
if (dt_hyxm_mx.Rows.Count != 0)
|
|
{
|
|
foreach (DataRow r in dt_hyxm_mx.Rows)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = "";
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = false;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
}
|
|
else if (ds.lx == 4) //其他项目
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
var vs = ServiceContainer.GetService<It_grgzb>();
|
|
|
|
DataTable dt_hyxm_mx = vs.GetQtxmMx(dt, dt1);
|
|
if (dt_hyxm_mx.Rows.Count != 0)
|
|
{
|
|
if (LoginUser.yydm == "1")
|
|
{
|
|
foreach (DataRow r in dt_hyxm_mx.Rows)
|
|
{
|
|
DataTable dt_nan = vs.GetQtMan(dt, dt1, r["zhbm"].ToString());
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = "";
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
|
|
int manCount = Convert.ToInt32(dt_nan.Rows[0][0]);
|
|
int womanCount = Convert.ToInt32(r["sl"]) - manCount;
|
|
double proportionMan = Convert.ToDouble(manCount) / Convert.ToDouble(r["sl"]) * 100;
|
|
dsl.man = manCount;
|
|
dsl.woman = womanCount;
|
|
dsl.proportionMan = proportionMan.ToString("F2") + "%";
|
|
dsl.proportionWoman = (100 - proportionMan).ToString("F2") + "%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = false;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = true;
|
|
this.dataGridView2.Columns[6].Visible = true;
|
|
this.dataGridView2.Columns[7].Visible = true;
|
|
this.dataGridView2.Columns[8].Visible = true;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
foreach (DataRow r in dt_hyxm_mx.Rows)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = "";
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = false;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
}
|
|
else if (ds.lx == 5) //后期增加的统计项目
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
var vs = ServiceContainer.GetService<It_grgzb>();
|
|
|
|
DataTable dt_lsjx_mx = vs.GetYzbmMx(dt, dt1, ds.flmc);
|
|
if (dt_lsjx_mx.Rows.Count != 0)
|
|
{
|
|
foreach (DataRow r in dt_lsjx_mx.Rows)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = "";
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = false;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
}
|
|
else if (ds.lx == 6) //医生工作量
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
var vs = ServiceContainer.GetService<It_grgzb>();
|
|
|
|
DataTable dt_lsjx_mx = vs.GetYsgzlMx(dt, dt1);
|
|
if (dt_lsjx_mx.Rows.Count != 0)
|
|
{
|
|
if (LoginUser.yydm == "1")
|
|
{
|
|
frmWaitingBox f = new frmWaitingBox((obj, args) =>
|
|
{
|
|
foreach (DataRow r in dt_lsjx_mx.Rows)
|
|
{
|
|
DataTable dt_nan = vs.GetYsgzlMan(dt, dt1, r["zhbm"].ToString(), r["xm"].ToString());
|
|
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = r["xm"].ToString();
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
|
|
int manCount = Convert.ToInt32(dt_nan.Rows[0][0]);
|
|
int womanCount = Convert.ToInt32(r["sl"]) - manCount;
|
|
double proportionMan = Convert.ToDouble(manCount) / Convert.ToDouble(r["sl"]) * 100;
|
|
dsl.man = manCount;
|
|
dsl.woman = womanCount;
|
|
dsl.proportionMan = proportionMan.ToString("F2") + "%";
|
|
dsl.proportionWoman = (100 - proportionMan).ToString("F2") + "%";
|
|
|
|
ldsl.Add(dsl);
|
|
}
|
|
|
|
}, 100000, "请等待...", false, false);
|
|
f.ShowDialog();
|
|
|
|
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = true;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = true;
|
|
this.dataGridView2.Columns[6].Visible = true;
|
|
this.dataGridView2.Columns[7].Visible = true;
|
|
this.dataGridView2.Columns[8].Visible = true;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
foreach (DataRow r in dt_lsjx_mx.Rows)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xm = r["xm"].ToString();
|
|
dsl.tm = 0;
|
|
dsl.sl = Convert.ToInt32(r["sl"]);
|
|
dsl.xmmc = r["zhmc"].ToString();
|
|
|
|
ldsl.Add(dsl);
|
|
}
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = true;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = true;
|
|
this.dataGridView2.Columns[4].Visible = false;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
}
|
|
else if (ds.lx == 7) //报告出具率
|
|
{
|
|
List<dto_gzltj_list> ldsl = new List<dto_gzltj_list>();
|
|
|
|
var vservice = ServiceContainer.GetService<It_ttgzb>();
|
|
String data = vservice.selectBgcjl(dt, dt1, fddm);
|
|
DataTable dt_bgcjl = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|
if (dt_bgcjl.Rows.Count != 0)
|
|
{
|
|
int count = dt_bgcjl.Rows.Count;
|
|
int one = 0;
|
|
int three = 0;
|
|
int five = 0;
|
|
foreach (DataRow r in dt_bgcjl.Rows)
|
|
{
|
|
if (Convert.ToInt32(r["tmztz"].ToString())>6)
|
|
{
|
|
if (string.IsNullOrEmpty(r["dyrq"].ToString()))
|
|
{
|
|
r["dyrq"] = "1900-01-01 00:00:00.000";
|
|
}
|
|
TimeSpan tss = Convert.ToDateTime(r["dyrq"]) - Convert.ToDateTime(r["dttjrq"]);
|
|
int ts = tss.Days;
|
|
switch (ts)
|
|
{
|
|
case 0:
|
|
one++;
|
|
break;
|
|
case 1:
|
|
one++;
|
|
break;
|
|
case 2:
|
|
three++;
|
|
break;
|
|
case 3:
|
|
three++;
|
|
break;
|
|
case 4:
|
|
five++;
|
|
break;
|
|
case 5:
|
|
five++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (one==0)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xmmc = "1日出具率";
|
|
dsl.cjl = "0%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
else
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xmmc = "1日出具率";
|
|
dsl.cjl = (Convert.ToDecimal(one) / Convert.ToDecimal(count) * 100).ToString("0.00") + "%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
|
|
if (three == 0)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xmmc = "3日出具率";
|
|
dsl.cjl = "0%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
else
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xmmc = "3日出具率";
|
|
dsl.cjl = (Convert.ToDecimal(three) / Convert.ToDecimal(count) * 100).ToString("0.00") + "%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
|
|
if (five == 0)
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xmmc = "5日出具率";
|
|
dsl.cjl = "0%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
else
|
|
{
|
|
dto_gzltj_list dsl = new dto_gzltj_list();
|
|
dsl.xmmc = "5日出具率";
|
|
dsl.cjl = (Convert.ToDecimal(five) / Convert.ToDecimal(count) * 100).ToString("0.00") + "%";
|
|
ldsl.Add(dsl);
|
|
}
|
|
|
|
|
|
this.dataGridView2.DataSource = ldsl;
|
|
this.dataGridView2.Columns[0].Visible = false;
|
|
this.dataGridView2.Columns[1].Visible = false;
|
|
this.dataGridView2.Columns[2].Visible = true;
|
|
this.dataGridView2.Columns[3].Visible = false;
|
|
this.dataGridView2.Columns[4].Visible = true;
|
|
|
|
this.dataGridView2.Columns[5].Visible = false;
|
|
this.dataGridView2.Columns[6].Visible = false;
|
|
this.dataGridView2.Columns[7].Visible = false;
|
|
this.dataGridView2.Columns[8].Visible = false;
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
this.dataGridView2.DataSource = null;
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
private void button2_Click(object sender, EventArgs e)
|
|
{
|
|
new Common.ExcelDC().ExportExcel("工作量统计", this.dataGridView2);
|
|
}
|
|
}
|
|
}
|