|
|
@@ -757,72 +757,58 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
757
|
757
|
|
|
758
|
758
|
#region 满意度
|
|
759
|
759
|
|
|
760
|
|
- public ActionResult GetMYDList()
|
|
|
760
|
+ public ActionResult GetMYDList(string mydys)
|
|
761
|
761
|
{
|
|
762
|
|
- #region 添加表格标题
|
|
763
|
|
- var columns = new List<string>();
|
|
764
|
|
- columns.Add("满意人数");
|
|
765
|
|
- columns.Add("不满意人数");
|
|
766
|
|
- columns.Add("入院科室");
|
|
767
|
|
- columns.Add("出院科室");
|
|
768
|
|
- #endregion
|
|
769
|
|
- return Success("获取满意度标题成功", columns);
|
|
770
|
|
- }
|
|
771
|
|
-
|
|
772
|
|
-
|
|
773
|
|
- public ActionResult GetMYDataList(string ks, string stime, string etime)
|
|
774
|
|
- {
|
|
775
|
|
- ActionResult res = NoToken("未知错误,请重新登录");
|
|
776
|
|
- DataTable dtNew = new DataTable();
|
|
777
|
|
- dtNew = GetDataMYD(ks, stime, etime);
|
|
778
|
|
- res = Success("获取满意度统计数据成功", dtNew);
|
|
779
|
|
-
|
|
780
|
|
- return res;
|
|
|
762
|
+
|
|
|
763
|
+ if (Request.IsAuthenticated)
|
|
|
764
|
+ {
|
|
|
765
|
+ return Success("获取满意度成功", GetDataMYD(mydys));
|
|
|
766
|
+ }
|
|
|
767
|
+ return NoToken("未知错误,请重新登录");
|
|
781
|
768
|
}
|
|
782
|
769
|
|
|
783
|
770
|
|
|
784
|
|
- private DataTable GetDataMYD(string ks, string stime, string etime)
|
|
|
771
|
+ private DataTable GetDataMYD(string mydys)
|
|
785
|
772
|
{
|
|
786
|
|
- BLL.O_SF_BINGRENQK o_SF_BINGRENQK = new BLL.O_SF_BINGRENQK();
|
|
787
|
|
- DataTable dtNew = new DataTable();
|
|
788
|
|
-
|
|
789
|
|
-
|
|
790
|
|
- DataColumn dc1 = new DataColumn("满意人数", Type.GetType("System.String"));
|
|
791
|
|
- DataColumn dc2 = new DataColumn("不满意人数", Type.GetType("System.String"));
|
|
792
|
|
- DataColumn dc3 = new DataColumn("入院科室", Type.GetType("System.String"));
|
|
793
|
|
- DataColumn dc4 = new DataColumn("出院科室", Type.GetType("System.String"));
|
|
794
|
|
-
|
|
795
|
|
- dtNew.Columns.Add(dc1);
|
|
796
|
|
- dtNew.Columns.Add(dc2);
|
|
797
|
|
- dtNew.Columns.Add(dc3);
|
|
798
|
|
- dtNew.Columns.Add(dc4);
|
|
|
773
|
+ DataTable dt = new DataTable();
|
|
|
774
|
+ dt.Columns.Add("科室");
|
|
|
775
|
+ dt.Columns.Add("满意度");
|
|
799
|
776
|
|
|
800
|
777
|
|
|
801
|
|
- string sql = " ";
|
|
|
778
|
+ var kslist = DbHelperSQL.Query("select distinct CYKS FROM SF_BINGRENQK").Tables[0];
|
|
|
779
|
+ var myd = DbHelperSQL.Query("select distinct a.CYKS,COUNT(b.F_MYD) from SF_BINGRENQK a,SF_Result b where a.BINGRENZYID=b.F_Id and b.F_MYD='满意' group by a.CYKS ").Tables[0];
|
|
802
|
780
|
|
|
803
|
|
- for (int i = 0; i < 24; i++)
|
|
|
781
|
+ foreach (DataRow dr in kslist.Rows)
|
|
804
|
782
|
{
|
|
805
|
|
- DateTime stimes = Convert.ToDateTime(stime + " 00:00:00").AddHours(i);
|
|
806
|
|
- DateTime etimes = Convert.ToDateTime(stime + " 00:59:59").AddHours(i);
|
|
807
|
|
- DataRow drNew = dtNew.NewRow();
|
|
|
783
|
+ var drnew = dt.NewRow();
|
|
|
784
|
+ var cyks = dr["CYKS"].ToString();
|
|
|
785
|
+ drnew["科室"] = cyks;
|
|
|
786
|
+ var my = myd.Select("CYKS='" + cyks + "'").FirstOrDefault()?.ItemArray[0].ToString() ?? "";
|
|
|
787
|
+ if (my != "")
|
|
|
788
|
+ {
|
|
|
789
|
+
|
|
|
790
|
+ var myl = myd.Select("CYKS='" + cyks + "'").FirstOrDefault()?.ItemArray[1].ToString() ?? "0";
|
|
|
791
|
+ drnew["满意度"] = myl;
|
|
|
792
|
+ }
|
|
|
793
|
+
|
|
|
794
|
+ dt.Rows.Add(drnew);
|
|
808
|
795
|
}
|
|
809
|
|
- return dtNew;
|
|
|
796
|
+ var dtnew = dt.Select("1=1").CopyToDataTable();
|
|
|
797
|
+
|
|
|
798
|
+
|
|
|
799
|
+ return dtnew;
|
|
810
|
800
|
|
|
811
|
801
|
}
|
|
812
|
802
|
/// <summary>
|
|
813
|
803
|
/// 导出
|
|
814
|
804
|
/// </summary>
|
|
815
|
|
- /// <param name="stime"></param>
|
|
816
|
|
- /// <param name="ks"></param>
|
|
817
|
|
- /// <param name="etime"></param>
|
|
818
|
|
- /// <returns></returns>
|
|
819
|
|
- public ActionResult ExportExcelMYD(string stime, string ks, string etime)
|
|
|
805
|
+ public ActionResult ExportExcelMYD(string mydys)
|
|
820
|
806
|
{
|
|
821
|
807
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
822
|
808
|
if (Request.IsAuthenticated)
|
|
823
|
809
|
{
|
|
824
|
810
|
NPOIHelper npoi = new NPOIHelper();
|
|
825
|
|
- DataTable dt = GetDataMYD(ks, stime, etime);
|
|
|
811
|
+ DataTable dt = GetDataMYD(mydys);
|
|
826
|
812
|
if (npoi.ExportToExcel("满意度数据", dt) == "")
|
|
827
|
813
|
{
|
|
828
|
814
|
return Success("导出成功");
|
|
|
@@ -836,171 +822,41 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
|
|
836
|
822
|
}
|
|
837
|
823
|
|
|
838
|
824
|
//获取图形数据
|
|
839
|
|
- public ActionResult GetMYDData(string years)
|
|
|
825
|
+ public ActionResult GetMYDData(string mydys)
|
|
840
|
826
|
{
|
|
841
|
827
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
842
|
828
|
if (Request.IsAuthenticated)
|
|
843
|
829
|
{
|
|
844
|
|
- string[] arr = new string[12];
|
|
845
|
|
-
|
|
846
|
|
- DataTable dt = new BLL.T_Call_CallRecords().GetList("1=1").Tables[0];
|
|
847
|
|
- DateTime dtNow;
|
|
|
830
|
+ var kslist = DbHelperSQL.Query("select distinct CYKS FROM SF_BINGRENQK").Tables[0];
|
|
|
831
|
+ var myd = DbHelperSQL.Query("select distinct a.CYKS,COUNT(b.F_MYD) from SF_BINGRENQK a,SF_Result b where a.BINGRENZYID=b.F_Id and b.F_MYD='满意' group by a.CYKS ").Tables[0];
|
|
|
832
|
+ var ksc = kslist.Rows.Count;
|
|
848
|
833
|
|
|
849
|
|
- if (string.IsNullOrEmpty(years))
|
|
850
|
|
- {
|
|
851
|
|
- dtNow = DateTime.Now;
|
|
852
|
|
- }
|
|
853
|
|
- else
|
|
854
|
|
- {
|
|
855
|
|
- dtNow = DateTime.Parse(years + "年");
|
|
856
|
|
- }
|
|
857
|
|
- for (int i = 1; i <= 12; i++)
|
|
|
834
|
+ Dictionary<string, double> dics = new Dictionary<string, double>();
|
|
|
835
|
+ for (int i = 0; i < ksc; i++)
|
|
858
|
836
|
{
|
|
859
|
|
- DateTime beginTime = Convert.ToDateTime(dtNow.Year + "-" + i + "-01 00:00:00");
|
|
860
|
|
- int days = DateTime.DaysInMonth(dtNow.Year, beginTime.Month);
|
|
861
|
|
- DataRow[] dtRow = dt.Select("begintime >='" + beginTime.ToString() + "' and beginTime<'" + beginTime.AddDays(days).AddSeconds(-1) + "'");
|
|
862
|
|
- if (dtRow.Length > 0)
|
|
863
|
|
- {
|
|
864
|
|
- arr[i - 1] = dtRow.Length.ToString();
|
|
865
|
|
- }
|
|
866
|
|
- else
|
|
867
|
|
- {
|
|
868
|
|
- arr[i - 1] = "0";
|
|
869
|
|
- }
|
|
870
|
|
- }
|
|
871
|
|
-
|
|
872
|
|
- res = Success("获取呼叫量图形数据成功", arr);
|
|
873
|
|
- }
|
|
874
|
|
- return res;
|
|
875
|
|
- }
|
|
876
|
|
-
|
|
877
|
|
-
|
|
878
|
|
-
|
|
879
|
|
- #endregion
|
|
880
|
|
-
|
|
881
|
|
- #region 单项满意度
|
|
882
|
|
- /// <summary>
|
|
883
|
|
- /// 获取表头
|
|
884
|
|
- /// </summary>
|
|
885
|
|
- /// <returns></returns>
|
|
886
|
|
- public ActionResult GetDXMYDList()
|
|
887
|
|
- {
|
|
888
|
|
- #region 添加表格标题
|
|
889
|
|
- var columns = new List<string>();
|
|
890
|
|
- columns.Add("服务态度");
|
|
891
|
|
- columns.Add("医疗技术");
|
|
892
|
|
- columns.Add("医疗费用");
|
|
893
|
|
- columns.Add("住院环境");
|
|
894
|
|
- columns.Add("窗口科室服务");
|
|
895
|
|
- #endregion
|
|
896
|
|
- return Success("获取单项满意度标题成功", columns);
|
|
897
|
|
- }
|
|
898
|
|
-
|
|
899
|
|
- public ActionResult GetDXMYDataList(string ks, string stime, string etime)
|
|
900
|
|
- {
|
|
901
|
|
- ActionResult res = NoToken("未知错误,请重新登录");
|
|
902
|
|
- DataTable dtNew = new DataTable();
|
|
903
|
|
- dtNew = GetDataDXMYD(ks, stime, etime);
|
|
904
|
|
- res = Success("获取满意度统计数据成功", dtNew);
|
|
905
|
|
-
|
|
906
|
|
- return res;
|
|
907
|
|
- }
|
|
908
|
|
-
|
|
909
|
|
- private DataTable GetDataDXMYD(string ks, string stime, string etime)
|
|
910
|
|
- {
|
|
911
|
|
- BLL.O_SF_BINGRENQK o_SF_BINGRENQK = new BLL.O_SF_BINGRENQK();
|
|
912
|
|
- DataTable dtNew = new DataTable();
|
|
913
|
|
-
|
|
914
|
|
-
|
|
915
|
|
- DataColumn dc1 = new DataColumn("服务态度", Type.GetType("System.String"));
|
|
916
|
|
- DataColumn dc2 = new DataColumn("医疗技术", Type.GetType("System.String"));
|
|
917
|
|
- DataColumn dc3 = new DataColumn("医疗费用", Type.GetType("System.String"));
|
|
918
|
|
- DataColumn dc4 = new DataColumn("住院环境", Type.GetType("System.String"));
|
|
919
|
|
- DataColumn dc5 = new DataColumn("窗口科室服务", Type.GetType("System.String"));
|
|
920
|
|
-
|
|
921
|
|
- dtNew.Columns.Add(dc1);
|
|
922
|
|
- dtNew.Columns.Add(dc2);
|
|
923
|
|
- dtNew.Columns.Add(dc3);
|
|
924
|
|
- dtNew.Columns.Add(dc4);
|
|
925
|
|
- dtNew.Columns.Add(dc5);
|
|
926
|
|
-
|
|
927
|
|
-
|
|
928
|
|
- string sql = " ";
|
|
929
|
|
-
|
|
930
|
|
- for (int i = 0; i < 24; i++)
|
|
931
|
|
- {
|
|
932
|
|
- DateTime stimes = Convert.ToDateTime(stime + " 00:00:00").AddHours(i);
|
|
933
|
|
- DateTime etimes = Convert.ToDateTime(stime + " 00:59:59").AddHours(i);
|
|
934
|
|
- DataRow drNew = dtNew.NewRow();
|
|
935
|
|
- }
|
|
936
|
|
- return dtNew;
|
|
|
837
|
+ var cyks = kslist.Rows[i]["CYKS"].ToString();
|
|
937
|
838
|
|
|
938
|
|
- }
|
|
|
839
|
+ var myl = myd.Select("CYKS='" + cyks + "'").FirstOrDefault()?.ItemArray[1].ToString() ?? "0";
|
|
|
840
|
+ var Rate = Math.Round(double.Parse(myl));
|
|
|
841
|
+ dics.Add(cyks, Rate);
|
|
939
|
842
|
|
|
940
|
|
- /// <summary>
|
|
941
|
|
- /// 导出
|
|
942
|
|
- /// </summary>
|
|
943
|
|
- /// <param name="stime"></param>
|
|
944
|
|
- /// <param name="ks"></param>
|
|
945
|
|
- /// <param name="etime"></param>
|
|
946
|
|
- /// <returns></returns>
|
|
947
|
|
- public ActionResult ExportExcelDXMYD(string stime, string ks, string etime)
|
|
948
|
|
- {
|
|
949
|
|
- ActionResult res = NoToken("未知错误,请重新登录");
|
|
950
|
|
- if (Request.IsAuthenticated)
|
|
951
|
|
- {
|
|
952
|
|
- NPOIHelper npoi = new NPOIHelper();
|
|
953
|
|
- DataTable dt = GetDataDXMYD(ks, stime, etime);
|
|
954
|
|
- if (npoi.ExportToExcel("单项满意度数据", dt) == "")
|
|
955
|
|
- {
|
|
956
|
|
- return Success("导出成功");
|
|
957
|
843
|
}
|
|
958
|
|
- else
|
|
|
844
|
+
|
|
|
845
|
+ dics = dics.OrderByDescending(p => p.Value).ToDictionary(p => p.Key, p => p.Value);
|
|
|
846
|
+ var obj = new
|
|
959
|
847
|
{
|
|
960
|
|
- return Error("导出失败");
|
|
961
|
|
- }
|
|
|
848
|
+ ks = dics.Keys,
|
|
|
849
|
+ rate = dics.Values
|
|
|
850
|
+ };
|
|
|
851
|
+
|
|
|
852
|
+ res = Success("获取满意度数据成功", obj);
|
|
962
|
853
|
}
|
|
963
|
854
|
return res;
|
|
964
|
855
|
}
|
|
965
|
856
|
|
|
966
|
|
- //获取图形数据
|
|
967
|
|
- public ActionResult GetDXMYData(string years)
|
|
968
|
|
- {
|
|
969
|
|
- ActionResult res = NoToken("未知错误,请重新登录");
|
|
970
|
|
- if (Request.IsAuthenticated)
|
|
971
|
|
- {
|
|
972
|
|
- string[] arr = new string[12];
|
|
973
|
857
|
|
|
974
|
|
- DataTable dt = new BLL.T_Call_CallRecords().GetList("1=1").Tables[0];
|
|
975
|
|
- DateTime dtNow;
|
|
976
|
858
|
|
|
977
|
|
- if (string.IsNullOrEmpty(years))
|
|
978
|
|
- {
|
|
979
|
|
- dtNow = DateTime.Now;
|
|
980
|
|
- }
|
|
981
|
|
- else
|
|
982
|
|
- {
|
|
983
|
|
- dtNow = DateTime.Parse(years + "年");
|
|
984
|
|
- }
|
|
985
|
|
- for (int i = 1; i <= 12; i++)
|
|
986
|
|
- {
|
|
987
|
|
- DateTime beginTime = Convert.ToDateTime(dtNow.Year + "-" + i + "-01 00:00:00");
|
|
988
|
|
- int days = DateTime.DaysInMonth(dtNow.Year, beginTime.Month);
|
|
989
|
|
- DataRow[] dtRow = dt.Select("begintime >='" + beginTime.ToString() + "' and beginTime<'" + beginTime.AddDays(days).AddSeconds(-1) + "'");
|
|
990
|
|
- if (dtRow.Length > 0)
|
|
991
|
|
- {
|
|
992
|
|
- arr[i - 1] = dtRow.Length.ToString();
|
|
993
|
|
- }
|
|
994
|
|
- else
|
|
995
|
|
- {
|
|
996
|
|
- arr[i - 1] = "0";
|
|
997
|
|
- }
|
|
998
|
|
- }
|
|
999
|
|
-
|
|
1000
|
|
- res = Success("获取呼叫量图形数据成功", arr);
|
|
1001
|
|
- }
|
|
1002
|
|
- return res;
|
|
1003
|
|
- }
|
|
|
859
|
+
|
|
1004
|
860
|
|
|
1005
|
861
|
#endregion
|
|
1006
|
862
|
}
|