From 80263c36e73042b5e30ce4dfcb89ee0eca0e9229 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 25 十二月 2023 14:26:20 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/工资管理/Pay_WorkTimesBillController.cs | 126 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 122 insertions(+), 4 deletions(-)
diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_WorkTimesBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_WorkTimesBillController.cs"
index 1863046..4030707 100644
--- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_WorkTimesBillController.cs"
+++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_WorkTimesBillController.cs"
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
@@ -107,7 +108,8 @@
",瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HEmpID" +
",HEmpNumber,HEmpName,鑱屽憳绯绘暟 HEmpRate,鍩烘湰澶╂暟 HBaseDays,鍩烘湰宸ユ椂 HBaseTimes,鍔犵彮宸ユ椂 HOverTimes,璇峰亣宸ユ椂 HLeaveTimes,鍔犵彮澶╂暟 HOverDays,璇峰亣澶╂暟 HLeaveDays,杩熷埌娆℃暟 HLateQty" +
",鍏嚭 HOutForComQty,绉佸嚭 HOutForEmpQty,鍏嚭鏃堕棿 HOutForComTimes,绉佸嚭鏃堕棿 HOutForEmpTimes,杩熷埌鏃堕棿 HLateTimes,鏃╅��娆℃暟 HEarlyQty,鏃╅��鏃堕棿 HEarlyTimes" +
- ",鏃峰伐澶╂暟 HAbsentDays,涓婂崍 HAMTimes,涓嬪崍 HPMTimes, 琛ㄤ綋澶囨敞 HRemark,HRestFlag,HSchClassID FROM h_v_Pay_WorkTimesBillList where 1 = 1 ";
+ ",鏃峰伐澶╂暟 HAbsentDays,涓婂崍 HAMTimes,涓嬪崍 HPMTimes,HCTPrjID,HCTPrjNumber,HCTPrjName,HWorkTypeID,HWorkTypeNumber,HWorkTypeName,HPayMoney,HMoney" +
+ ",琛ㄤ綋澶囨敞 HRemark,HRestFlag,HSchClassID FROM h_v_Pay_WorkTimesBillList where 1 = 1 ";
string sql = sql1 + sqlWhere;
ds = oCN.RunProcReturn(sql, "h_v_Pay_WorkTimesBillList");
objJsonResult.code = "0";
@@ -125,6 +127,7 @@
return objJsonResult;
}
#endregion
+
/// <summary>
/// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
///鍙傛暟锛歴tring sql銆�
@@ -144,6 +147,7 @@
string UserName = "";
string s = "";
+ DBUtility.ClsPub.CurUserName = msg4; //鎿嶄綔浜�
ListModels oListModels = new ListModels();
try
{
@@ -241,7 +245,7 @@
{
i++;
oItemSub.HEntryID = i;
- oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate("");
oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
@@ -326,6 +330,120 @@
return objJsonResult;
}
}
- //
+ /// <summary>
+ /// 閫氳繃鐝粍鏌ヨ鑱屽憳淇℃伅
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Pay_WorkTimesBill/GetEmployeeByHGroup")]
+ [HttpGet]
+ public object GetEmployeeByHGroup(int HGroupID)
+ {
+ if (HGroupID <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鐝粍鏈�夋嫨";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ List<object> list = new List<object>();
+ DataSet ds1;
+ string sql1 = string.Format(@"select a.HItemID HEmpID,a.HNumber HEmpNumber,a.HName HEmpName,a.HEmpRate HEmpRate,a.HCTPrjID,b.HName HCTPrjName from Gy_Employee a
+ left join Gy_ClassTimePrjGroup b on a.HCTPrjID=b.HItemID
+ where a.HGroupID=" + HGroupID);
+ ds1 = oCN.RunProcReturn(sql1, "Gy_Employee");
+ list.Add(ds1.Tables[0]);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.list = list;
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ [Route("Pay_WorkTimesBill/calcAvgMoney")]
+ [HttpPost]
+ public object GetEmployeeByHGroup([FromBody] JObject msg) {
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ List<object> list = new List<object>();
+ DataSet ds;
+ string sql = string.Format($"exec h_p_CalcAvgMoney '{msg["msg"]}'");
+ ds = oCN.RunProcReturn(sql, "h_p_CalcAvgMoney");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ #region 鑰冨嫟姹囨�绘暟鎹鐞嗚〃鏌ヨ
+ [Route("Pay_WorkTimesSumQueryBill/list")]
+ [HttpGet]
+ public object getWorkTimesSumQueryBillList(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log("Pay_WorkTimesSumQueryBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ ds = oCN.RunProcReturn("exec h_p_Pay_WorkTimesSumQueryBillList " + sWhere, "Pay_WorkTimesSumQueryBillList");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1