From e03143079456fa14c979d92ad7772995d677f4b0 Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期三, 27 七月 2022 10:15:15 +0800 Subject: [PATCH] 雅琪诺报表 --- WebAPI/Controllers/工资管理/Pay_MonthlySalaryReportController.cs | 103 +++++++++++++++++ WebAPI/Controllers/工资管理/Pay_PieceRateWageReportController.cs | 104 +++++++++++++++++ WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs | 107 +++++++++++++++++ WebAPI/WebAPI.csproj | 3 WebAPI/Models/动态列/OptionListModel.cs | 16 ++ 5 files changed, 330 insertions(+), 3 deletions(-) diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs index b076c66..00f955e 100644 --- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs +++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs @@ -78,6 +78,106 @@ } } + [Route("Cg_POOrderBill/list3")] + [HttpGet] + public object list3(string sWhere, string user) + { + try + { + List<string> optionList = new List<string>(); + string sql = "select top 1 * from h_v_IF_POOrderBillList where 1 = 1 "; + ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList"); + if (ds != null) + { + foreach (DataColumn item in ds.Tables[0].Columns) + { + optionList.Add(@"{ field: 'hmainid', title: '"+ item.ToString() + "', sort: true, hide: false }"); + } + string option = string.Join(",",optionList); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = optionList.ToArray(); + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒濆鍖栬〃鏍煎け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + [Route("Cg_POOrderBill/list2")] + [HttpGet] + public object list2(string sWhere, string user) + { + try + { + List<OptionListModel> optionList = new List<OptionListModel>(); + string sql = "select top 1 * from h_v_IF_POOrderBillList where 1 = 1 "; + ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList"); + if (ds != null) + { + foreach (DataColumn item in ds.Tables[0].Columns) + { + optionList.Add(new OptionListModel + { + field = item.ToString(), + title = item.ToString(), + sort = true, + hide = false, + }); + } + string option = string.Join(",", optionList); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = optionList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒濆鍖栬〃鏍煎け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + /// <summary> /// 閲囪喘璁㈠崟 鍒嗛厤 ///鍙傛暟锛歴tring sql銆� @@ -201,13 +301,13 @@ /// </summary> [Route("Cg_POOrderBill/Resynchronize")] [HttpGet] - public object Resynchronize(string HBillNo,string HBillType) + public object Resynchronize(string HBillNo, string HBillType) { try { oCN.BeginTran(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - DataSet DS = oCn.RunProcReturn("exec h_p_WMS_ERPSourceBillToLocal '" + HBillNo + "','"+ HBillType + "'", "h_p_WMS_ERPSourceBillToLocal"); + DataSet DS = oCn.RunProcReturn("exec h_p_WMS_ERPSourceBillToLocal '" + HBillNo + "','" + HBillType + "'", "h_p_WMS_ERPSourceBillToLocal"); if (DS == null) { objJsonResult.code = "0"; @@ -325,7 +425,7 @@ else fidList.Add(dr["FID"].ToString() + dr["HINTERID"].ToString()); - DataRow[] drs = dt.Select("FID = " + dr["FID"].ToString() + " and HINTERID = "+dr["HINTERID"].ToString()); + DataRow[] drs = dt.Select("FID = " + dr["FID"].ToString() + " and HINTERID = " + dr["HINTERID"].ToString()); JObject model = new JObject(); model.Add("FBILLTYPEID", new JObject() { ["Fnumber"] = "SLD01_SYS" }); //鍗曟嵁绫诲瀷 @@ -561,4 +661,5 @@ // } + } \ No newline at end of file diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_MonthlySalaryReportController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_MonthlySalaryReportController.cs" new file mode 100644 index 0000000..926e7e4 --- /dev/null +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_MonthlySalaryReportController.cs" @@ -0,0 +1,103 @@ +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Pub_Class; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers +{ + public class Pay_MonthlySalaryReportController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + /// <summary> + /// 杩斿洖閲囪喘璁㈠崟鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Pay_MonthlySalaryReport/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + string sql = $"exec [h_p_MonthlySalaryReport] '{sWhere}'"; + ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList"); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + [Route("Pay_MonthlySalaryReport/list2")] + [HttpGet] + public object list2(string sWhere) + { + try + { + List<OptionListModel> optionList = new List<OptionListModel>(); + string sql = $"exec [h_p_MonthlySalaryReport] '{sWhere}'"; + ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList"); + if (ds != null) + { + foreach (DataColumn item in ds.Tables[0].Columns) + { + optionList.Add(new OptionListModel + { + field = item.ToString(), + title = item.ToString(), + sort = true, + hide = false, + }); + } + string option = string.Join(",", optionList); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = optionList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒濆鍖栬〃鏍煎け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + } +} \ No newline at end of file diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_PieceRateWageReportController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_PieceRateWageReportController.cs" new file mode 100644 index 0000000..938a535 --- /dev/null +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_PieceRateWageReportController.cs" @@ -0,0 +1,104 @@ +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Pub_Class; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers +{ + public class Pay_PieceRateWageReportController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + /// <summary> + /// 杩斿洖閲囪喘璁㈠崟鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Pay_PieceRateWageReport/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + string sql = $"exec [h_p_PieceRateWageReport] '{sWhere}'"; + ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList"); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + [Route("Pay_PieceRateWageReport/list2")] + [HttpGet] + public object list2(string sWhere) + { + try + { + List<OptionListModel> optionList = new List<OptionListModel>(); + string sql = $"exec [h_p_PieceRateWageReport] '{sWhere}'"; + ds = oCN.RunProcReturn(sql, "h_v_IF_POOrderBillList"); + if (ds != null) + { + foreach (DataColumn item in ds.Tables[0].Columns) + { + optionList.Add(new OptionListModel + { + field = item.ToString(), + title = item.ToString(), + sort = true, + hide = false, + }); + } + string option = string.Join(",", optionList); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = optionList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒濆鍖栬〃鏍煎け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + } +} \ No newline at end of file diff --git "a/WebAPI/Models/\345\212\250\346\200\201\345\210\227/OptionListModel.cs" "b/WebAPI/Models/\345\212\250\346\200\201\345\210\227/OptionListModel.cs" new file mode 100644 index 0000000..6723b97 --- /dev/null +++ "b/WebAPI/Models/\345\212\250\346\200\201\345\210\227/OptionListModel.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class OptionListModel + { + public string field { get; set; } + public string title { get; set; } + public bool sort { get; set; } + public bool hide { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index b125d7f..e3ea52f 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -428,6 +428,8 @@ <Compile Include="Controllers\浠撳瓨绠$悊\楠屾敹鍏ュ簱\Kf_StepFoldinBillController.cs" /> <Compile Include="Controllers\鍗氭棩鑷姩鎵爜绾縗ScanlineAPIController.cs" /> <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_StockCheckItemBillController.cs" /> + <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_MonthlySalaryReportController.cs" /> + <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_PieceRateWageReportController.cs" /> <Compile Include="Controllers\宸ヨ祫绠$悊\Gy_ClassTimePrjBillController.cs" /> <Compile Include="Controllers\宸ヨ祫绠$悊\Gy_ClassTimePrjSubController.cs" /> <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_OtherBalBillController.cs" /> @@ -572,6 +574,7 @@ <Compile Include="Models\Sc_WorkBillSortBillSub.cs" /> <Compile Include="Models\Sc_WorkDemandPlanBillMain.cs" /> <Compile Include="Models\Sc_WorkDemandPlanBillSub.cs" /> + <Compile Include="Models\鍔ㄦ�佸垪\OptionListModel.cs" /> <Compile Include="Models\宸ヨ祫绠$悊\ClsGy_ClassTimePrj_Model.cs" /> <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_GroupBalBillEmp.cs" /> <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_GroupBalBillMain.cs" /> -- Gitblit v1.9.1