From c0ea121256e4c23dba0efda571269c706766126a Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期三, 08 十二月 2021 19:13:03 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- /dev/null | 311 ---------------- WebAPI/ListModels.cs | 36 + WebAPI/Controllers/工资管理/Pay_WorkTimesBillController.cs | 315 ++++++++++++++++ WebAPI/DLL/工资管理/ClsPay_WorkTimesBill.cs | 272 ++++++++++++++ WebAPI/Models/工资管理/ClsPay_WorkTimesBillMain.cs | 14 WebAPI/Models/工资管理/ClsPay_WorkTimesBillSub.cs | 37 + WebAPI/WebAPI.csproj | 5 WebAPI/Controllers/工资管理/Pay_GroupBalBillController.cs | 144 +++++++ 8 files changed, 820 insertions(+), 314 deletions(-) diff --git a/WebAPI/Controllers/Pay_WorkTimesBillController.cs b/WebAPI/Controllers/Pay_WorkTimesBillController.cs deleted file mode 100644 index 6a08ead..0000000 --- a/WebAPI/Controllers/Pay_WorkTimesBillController.cs +++ /dev/null @@ -1,311 +0,0 @@ -锘縰sing 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_WorkTimesBillController : ApiController - { - public DBUtility.ClsPub.Enum_BillStatus BillStatus; - - private json objJsonResult = new json(); - public DataSet ds = new DataSet(); - public WebServer webserver = new WebServer(); - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - //DataSet ds; - - - /// <summary> - /// 杩斿洖鑰冨嫟姹囨姤鍗曞垪琛� - ///鍙傛暟锛歴tring sql銆� - ///杩斿洖鍊硷細object銆� - /// </summary> - [Route("Pay_WorkTimesBill/GetWorkTimesBill")] - [HttpGet] - public object GetWorkTimesBill(string sWhere) - { - try - { - - ds = Sc_GetWorkTimesBill(sWhere); - 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; - } - } - - public static DataSet Sc_GetWorkTimesBill(string sWhere) - { - if (sWhere == null || sWhere.Equals("")) - { - return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_WorkTimesBillList order by 鏃ユ湡 desc", "h_v_Pay_WorkTimesBillList"); - } - else - { - string sql1 = "select * from h_v_Pay_WorkTimesBillList where 1 = 1 "; - string sql = sql1 + sWhere + "order by 鏃ユ湡 desc"; - return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_WorkTimesBillList"); - } - - } - - #region[鑰冨嫟姹囨姤鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] - [Route("Pay_WorkTimesBill/Pay_WorkTimesBillListCheckDetail")] - [HttpGet] - public ApiResult<DataSet> Pay_WorkTimesBillListCheckDetail(string HID) - { - if (string.IsNullOrEmpty(HID)) - return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - - var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Pay_WorkTimesBillList where hmainid= " + HID + " ", "h_v_Pay_WorkTimesBillList"); - if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) - return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ粨绠楀崟鍙�" }; - - return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; - } - #endregion - - #region[鑰冨嫟姹囨姤鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] - [Route("Pay_WorkTimesBill/Pay_WorkTimesBillListProjectDetai")] - [HttpGet] - public object Pay_WorkTimesBillListProjectDetai(string sqlWhere) - { - DataSet ds; - try - { - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - string sql1 = "SELECT HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬,HGroupID" + - ",鐝粍浠g爜,鐝粍,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡,瀹℃牳浜�" + - ",瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HEmpID" + - ",HEmpNumber,HEmpName,鑱屽憳绯绘暟,鍩烘湰宸ユ椂,鍔犵彮宸ユ椂,璇峰亣宸ユ椂" + - ",鍏嚭,绉佸嚭,鍏嚭鏃堕棿,绉佸嚭鏃堕棿,杩熷埌鏃堕棿,鏃╅��娆℃暟,鏃╅��鏃堕棿" + - ",鏃峰伐澶╂暟,鍘備紤,涓婂崍,涓嬪崍 FROM h_v_Pay_WorkTimesBillList where 1 = 1 "; - string sql = sql1 + sqlWhere; - ds = oCN.RunProcReturn(sql, "h_v_Pay_WorkTimesBillList"); - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; - } - catch (Exception e) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); - objJsonResult.data = null; - } - return objJsonResult; - } - #endregion - /// <summary> - /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 - ///鍙傛暟锛歴tring sql銆� - ///杩斿洖鍊硷細object銆� - /// </summary> - [Route("Pay_WorkTimesBill/AddBill")] - [HttpPost] - public object AddBill([FromBody] JObject sMainSub) - { - var _value = sMainSub["sMainSub"].ToString(); - string msg1 = _value.ToString(); - oCN.BeginTran(); - //淇濆瓨涓昏〃 - objJsonResult = AddBillMain(msg1); - if (objJsonResult.code == "0") - { - oCN.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = objJsonResult.Message; - objJsonResult.data = null; - return objJsonResult; - } - oCN.Commit(); - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - public json AddBillMain(string msg1) - { - string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); - string msg2 = sArray[0].ToString(); - string msg3 = sArray[1].ToString(); - try - { - msg2 = "[" + msg2.ToString() + "]"; - List<Pay_WorkTimesBill> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pay_WorkTimesBill>>(msg2); - string HBillType = "2203"; - long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D - string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 - DateTime HDate = mainList[0].HDate;//鏃ユ湡 - int HYear = 2021; - double HPeriod = 1; - string HRemark = mainList[0].HRemark;//澶囨敞 - string HBillSubType = "2203"; - string HMaker = mainList[0].HMaker; - DateTime HMaterID = mainList[0].HMakeDate;//浜у搧ID - long HGroupID = mainList[0].HGroupID; - long HDeptID = mainList[0].HDeptID; - long HPayType = mainList[0].HPayType; - bool HSaveType = mainList[0].HSaveType; - //long HMaterTypeID = 0; - int HPRDORGID = mainList[0].HPRDORGID; //缁勭粐 - - //涓昏〃 - oCN.RunProc("Insert Into Pay_WorkTimesBillMain " + - "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + - ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + - ",HDeptID,HGroupID,HPayType,HSaveType" + - ") " + - " values('" + HBillType + "','" + HBillSubType + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HDate + "'" + - ", " + HYear.ToString() + "," + HPeriod.ToString() + ",'" + HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + - ", " + HDeptID.ToString() + "," + HGroupID.ToString() + ",'" + HPayType + "'," + DBUtility.ClsPub.BoolToString(HSaveType) + - ") "); - - //淇濆瓨瀛愯〃 - objJsonResult = AddBillSub(msg3, HInterID); - if (objJsonResult.code == "0") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = objJsonResult.Message; - objJsonResult.data = null; - return objJsonResult; - } - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = null; - objJsonResult.data = null; - return objJsonResult; - } - catch (Exception e) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "Exception锛�" + e.ToString(); - objJsonResult.data = null; - return objJsonResult; - } - } - - public json AddBillSub(string msg3, long HInterID) - { - List<Pay_WorkTimesBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pay_WorkTimesBillSub>>(msg3); - for (int i = 0; i < subList.ToArray().Length; i++) - { - long HEntryID = subList[0].HEntryID;//宸ユID - string HCloseMan = subList[0].HCloseMan; - long HCloseType = subList[0].HCloseType; - //DateTime HEntryCloseDate = subList[0].HEntryCloseDate; - string HRemark = subList[0].HRemark; - long HSourceInterID = subList[0].HSourceInterID; - long HSourceEntryID = subList[0].HSourceEntryID; - string HSourceBillNo = subList[0].HSourceBillNo; - string HSourceBillType = subList[0].HSourceBillType; - decimal HRelationQty = subList[0].HRelationQty; - decimal HRelationMoney = subList[0].HRelationMoney; - long HEmpID = subList[0].HEmpID; - decimal HEmpRate = subList[0].HEmpRate; - decimal HPMTimes = subList[0].HPMTimes; - decimal HAMTimes = subList[0].HAMTimes; - decimal HBaseTimes = subList[0].HBaseTimes; - decimal HBaseDays = subList[0].HBaseDays; - decimal HOverTimes = subList[0].HOverTimes; - decimal HOverDays = subList[0].HOverDays; - decimal HLeaveTimes = subList[0].HLeaveTimes; - decimal HLeaveDays = subList[0].HLeaveDays; - long HLateQty = subList[0].HLateQty; - decimal HLateTimes = subList[0].HLateTimes; - long HEarlyQty = subList[0].HEarlyQty; - decimal HEarlyTimes = subList[0].HEarlyTimes; - long HOutForEmpQty = subList[0].HOutForEmpQty; - decimal HOutForEmpTimes = subList[0].HOutForEmpTimes; - long HOutForComQty = subList[0].HOutForComQty; - decimal HOutForComTimes = subList[0].HOutForComTimes; - long HAbsentDays = subList[0].HAbsentDays; - long HRestFlag = subList[0].HRestFlag; - long HSchClassID = subList[0].HSchClassID; - //decimal HNeedTimes = subList[0].HNeedTimes; - long HCTPrjID = subList[0].HCTPrjID; - long HWorkTypeID = subList[0].HWorkTypeID; - decimal HPayMoney = subList[0].HPayMoney; - decimal HMoney = subList[0].HMoney; - - string sql = "Insert into Pay_WorkTimesBillSub " + - " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + - ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + - ",HEmpID,HEmpRate,HPMTimes,HAMTimes,HBaseTimes,HBaseDays" + - ",HOverTimes,HOverDays,HLeaveTimes,HLeaveDays,HLateQty,HLateTimes" + - ",HEarlyQty,HEarlyTimes,HOutForEmpQty,HOutForEmpTimes,HOutForComQty,HOutForComTimes" + - ",HAbsentDays,HRestFlag,HSchClassID,HCTPrjID,HWorkTypeID,HPayMoney,HMoney" + - ") values(" - + HInterID.ToString() + "," + HEntryID.ToString() + ",'" + HCloseMan + "',''," + HCloseType + ",'" + HRemark + "'" + - "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'," + HRelationQty.ToString() + "," + HRelationMoney.ToString() + - "," + HEmpID.ToString() + "," + HEmpRate.ToString() + "," + HPMTimes.ToString() + "," + HAMTimes.ToString() + "," + HBaseTimes.ToString() + "," + HBaseDays.ToString() + - "," + HOverTimes.ToString() + "," + HOverDays.ToString() + "," + HLeaveTimes.ToString() + "," + HLeaveDays.ToString() + "," +HLateQty.ToString() + "," + HLateTimes.ToString() + - "," + HEarlyQty.ToString() + "," + HEarlyTimes.ToString() + "," + HOutForEmpQty.ToString() + "," + HOutForEmpTimes.ToString() + "," + HOutForComQty.ToString() + "," + HOutForComTimes.ToString() + - "," + HAbsentDays.ToString() + "," + HRestFlag.ToString() + "," + HSchClassID.ToString() + "," + HCTPrjID.ToString() + "," + HWorkTypeID.ToString() + "," + HPayMoney.ToString() + "," + HMoney.ToString() + - ") "; - oCN.RunProc(sql); - } - - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = null; - objJsonResult.data = null; - return objJsonResult; - } - /// <summary> - ///宸ヨ祫缁撶畻涓汉鍗曞垹闄ゅ姛鑳� - /// </summary> - /// <returns></returns> - [Route("Pay_WorkTimesBill/DeltetWorkTimesBill")] - [HttpGet] - public object DeltetWorkTimesBill(string HInterID) - { - try - { - oCN.BeginTran(); - oCN.RunProc("Delete From Pay_WorkTimesBillMain where HInterID = " + HInterID); - oCN.RunProc("Delete From Pay_WorkTimesBillSub where HInterID = " + HInterID); - oCN.Commit(); - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; - objJsonResult.data = null; - return objJsonResult; - } - catch (Exception e) - { - oCN.RollBack(); - 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_GroupBalBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" index 5a974ca..7d9ddea 100644 --- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_GroupBalBillController.cs" @@ -94,13 +94,13 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - string sql = @"SELECT HMaterID,HMaterCode,HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,HUnitNumber,HUnitName + string sql = @"SELECT HMaterID,HMaterCode,HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,HUnitNumber,HUnitName, HProcID,HProcNumber,HProcName,HSourceID,HSourceNumber,HSourceName,宸ユ椂 HTimes,鏁伴噺 HQty,宸ヤ环 HPrice,閲戦 HMoney, HSumMoney,HOtherSubsidy,HOtherDeduct,HPayMoney FROM h_v_Pay_GroupBalBillList where 1 = 1 " + sqlWhere; ds = oCN.RunProcReturn(sql, "h_v_Pay_GroupBalBillList"); string sql1 = @"select HEmpID ,b.HNumber HEmpNumber, b.HName HEmpName, b.HEmpRate HEmpRate, HBaseTimes, HMoney, HOtherSubsidy, HOtherSubsidy, HYF,'' HISZF ,'' HISFT , a.HRemark from Pay_GroupBalBillEmp a - left join Gy_Employee b on a.HEmpID = b.HItemID " + sqlWhere.Replace("hmainid", "HInterID"); + left join Gy_Employee b on a.HEmpID = b.HItemID where 1 = 1 " + sqlWhere.Replace("hmainid", "HInterID"); ds1 = oCN.RunProcReturn(sql1, "Pay_GroupBalBillEmp"); list.Add(ds.Tables[0]); list.Add(ds1.Tables[0]); @@ -120,6 +120,146 @@ } #endregion + + + #region 璁惧淇濆吇璁″垝琛� 淇濆瓨/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Pay_GroupBalBill/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject sMainSub) + { + var _value = sMainSub["sMainSub"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + + string UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DLL.ClsPay_GroupBalBill oBill = new DLL.ClsPay_GroupBalBill(); + List<Models.ClsPay_GroupBalBillMain> lsmain = new List<Models.ClsPay_GroupBalBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Pay_GroupBalBillMain(msg2); + foreach (Models.ClsPay_GroupBalBillMain oItem in lsmain) + { + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "2202"; + oItem.HBillSubType = "2202"; + //oItem.HInterID =0; + //oItem.HBillNo = ""; + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //淇濆吇椤硅〃浣撴暟鎹� + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Models.ClsPay_GroupBalBillSub> ls = new List<Models.ClsPay_GroupBalBillSub>(); + ls = oListModels.getObjectByJson_Pay_GroupBalBillSub(msg3); + int i = 0; + foreach (Models.ClsPay_GroupBalBillSub item in ls) + { + i++; + item.HEntryID = i; + //oItemSub.HCloseMan = ""; //琛屽叧闂� + item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + item.HCloseType = false; //鍏抽棴绫诲瀷 + //oItemSub.HRemark = ""; //澶囨敞 + item.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� + item.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� + //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 + //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 + item.HRelationQty = 0; //鍏宠仈鏁伴噺 + oBill.DetailColl.Add(item); + + } + //閰嶄欢椤硅〃浣撴暟鎹� + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg4 = msg4.Substring(1, msg4.Length - 2); + msg4 = msg4.Replace("\\", ""); + msg4 = msg4.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Models.ClsPay_GroupBalBillEmp> ls1 = new List<Models.ClsPay_GroupBalBillEmp>(); + ls1 = oListModels.getObjectByJson_Pay_GroupBalBillEmp(msg4); + int j = 0; + foreach (Models.ClsPay_GroupBalBillEmp oItemSub in ls1) + { + + j++; + oItemSub.HEntryID = j; + //oItemSub.HCloseMan = ""; //琛屽叧闂� + oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 + //oItemSub.HRemark = ""; //澶囨敞 + oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� + oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� + //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 + //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 + oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 + oBill.DetailEmpColl.Add(oItemSub); + + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.omodel.HInterID == 0) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + #endregion + /// <summary> ///宸ヨ祫缁撶畻涓汉鍗曞垹闄ゅ姛鑳� /// </summary> 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" new file mode 100644 index 0000000..587d53e --- /dev/null +++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_WorkTimesBillController.cs" @@ -0,0 +1,315 @@ +锘縰sing 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_WorkTimesBillController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + public WebServer webserver = new WebServer(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + public DLL.ClsPay_WorkTimesBill BillNew0 = new DLL.ClsPay_WorkTimesBill(); // + public DLL.ClsPay_WorkTimesBill BillOld0 = new DLL.ClsPay_WorkTimesBill(); // + //DataSet ds; + + + /// <summary> + /// 杩斿洖鑰冨嫟姹囨姤鍗曞垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Pay_WorkTimesBill/GetWorkTimesBill")] + [HttpGet] + public object GetWorkTimesBill(string sWhere) + { + try + { + + ds = Sc_GetWorkTimesBill(sWhere); + 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; + } + } + + public static DataSet Sc_GetWorkTimesBill(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_WorkTimesBillList order by 鏃ユ湡 desc", "h_v_Pay_WorkTimesBillList"); + } + else + { + string sql1 = "select * from h_v_Pay_WorkTimesBillList where 1 = 1 "; + string sql = sql1 + sWhere + "order by 鏃ユ湡 desc"; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_WorkTimesBillList"); + } + + } + + #region[鑰冨嫟姹囨姤鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] + [Route("Pay_WorkTimesBill/Pay_WorkTimesBillListCheckDetail")] + [HttpGet] + public ApiResult<DataSet> Pay_WorkTimesBillListCheckDetail(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Pay_WorkTimesBillList where hmainid= " + HID + " ", "h_v_Pay_WorkTimesBillList"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ粨绠楀崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region[鑰冨嫟姹囨姤鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁] + [Route("Pay_WorkTimesBill/Pay_WorkTimesBillListProjectDetai")] + [HttpGet] + public object Pay_WorkTimesBillListProjectDetai(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql1 = "SELECT HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬,HGroupID" + + ",鐝粍浠g爜,鐝粍,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡,瀹℃牳浜�" + + ",瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,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 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_Pay_WorkTimesBillList"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Pay_WorkTimesBill/SaveGetWorkTimesBillList")] + [HttpPost] + public object SaveGetWorkTimesBillList([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string refSav = sArray[2].ToString(); + //string msg4 = sArray[3].ToString(); + + string UserName = ""; + string s = ""; + ListModels oListModels = new ListModels(); + try + { + ////缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log_second("Pay_SingleBalBill_Edit", 1, true, msg4)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + DLL.ClsPay_WorkTimesBill oBill = new DLL.ClsPay_WorkTimesBill(); + List<Models.ClsPay_WorkTimesBillMain> lsmain = new List<Models.ClsPay_WorkTimesBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Pay_WorkTimesBillMain(msg2); + foreach (Models.ClsPay_WorkTimesBillMain oItem in lsmain) + { + if (refSav == "Add") + { + //鍗曟嵁鍙锋槸鍚﹂噸澶� + if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒"; + objJsonResult.data = 1; + return objJsonResult; + } + } + if (refSav == "Update") + { + if (BillOld0.ShowBill(oItem.HInterID, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹湁璇紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鍒ゆ柇鏄惁鍙紪杈� + if (BillOld0.omodel.HChecker != "" && BillOld0.omodel.HChecker != null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + if (BillOld0.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld0, ref s)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s + "锛屼笉鍏佽淇敼"; + objJsonResult.data = 1; + return objJsonResult; + } + } + UserName = oItem.HMaker; //鍒跺崟浜� + oItem.HBillType = "2203"; + oItem.HBillSubType = "2203"; + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Models.ClsPay_WorkTimesBillSub> ls = new List<Models.ClsPay_WorkTimesBillSub>(); + ls = oListModels.getObjectByJson_Pay_WorkTimesBillSub(msg3); + int i = 0; + foreach (Models.ClsPay_WorkTimesBillSub oItemSub in ls) + { + i++; + oItemSub.HEntryID = i; + oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 + oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� + oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� + oBill.DetailColl.Add(oItemSub); + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.omodel.HInterID == 0) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + ///宸ヨ祫缁撶畻涓汉鍗曞垹闄ゅ姛鑳� + /// </summary> + /// <returns></returns> + [Route("Pay_WorkTimesBill/DeltetWorkTimesBill")] + [HttpGet] + public object DeltetWorkTimesBill(string HInterID) + { + try + { + oCN.BeginTran(); + oCN.RunProc("Delete From Pay_WorkTimesBillMain where HInterID = " + HInterID); + oCN.RunProc("Delete From Pay_WorkTimesBillSub where HInterID = " + HInterID); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + 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/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.cs" "b/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.cs" new file mode 100644 index 0000000..008f634 --- /dev/null +++ "b/WebAPI/DLL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBill.cs" @@ -0,0 +1,272 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace WebAPI.DLL +{ + public class ClsPay_WorkTimesBill:DBUtility.ClsXt_BaseBill + { + public Models.ClsPay_WorkTimesBillMain omodel = new Models.ClsPay_WorkTimesBillMain(); + public List<Models.ClsPay_WorkTimesBillSub> DetailColl = new List<Models.ClsPay_WorkTimesBillSub>(); + + public ClsPay_WorkTimesBill() + { + base.MvarItemKeySub = "Pay_WorkTimesBillSub"; + base.MvarItemKeySub2 = ""; + base.MvarItemKeySub3 = ""; + base.MvarItemKeySub4 = ""; + base.MvarItemKey="Pay_WorkTimesBillMain"; + base.MvarReportTitle="鑰冨嫟姹囨姤鍗�"; + base.BillType="2203"; + base.HBillSubType = "2203"; + + } + + #region 鍥哄畾浠g爜 + + ~ClsPay_WorkTimesBill() + { + DetailColl = null; + } + + #endregion 鑷畾涔夋柟娉� + //淇敼鍗曟嵁 + public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) + { + try + { + // + oCn.BeginTran(); + //鏇存柊涓昏〃 + oCn.RunProc("UpDate Pay_WorkTimesBillMain set " + + " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��=============== + ",HDate='" + omodel.HDate + "'" + + ",HYear='" + omodel.HYear.ToString() + "'" + + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + + ",HRemark='" + omodel.HRemark + "'" + + ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + + ",HUpDateDate=getdate()" + + //======================================== + ",HDeptID=" + omodel.HDeptID.ToString() + + ",HGroupID=" + omodel.HGroupID.ToString() + + ",HPayType='" + omodel.HPayType + "'" + + ",HSaveType=" + DBUtility.ClsPub.BoolToString(omodel.HSaveType) + + " where HInterID=" + lngBillKey.ToString()); + //鍒犻櫎鍏宠仈 + DeleteRelation(ref sReturn, lngBillKey); + //鍒犻櫎瀛愯〃 + DeleteBillSub(lngBillKey); + //鎻掑叆瀛愯〃 + omodel.HInterID = lngBillKey; + foreach (Models.ClsPay_WorkTimesBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Pay_WorkTimesBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HEmpID,HEmpRate,HPMTimes,HAMTimes,HBaseTimes,HBaseDays" + + ",HOverTimes,HOverDays,HLeaveTimes,HLeaveDays,HLateQty,HLateTimes" + + ",HEarlyQty,HEarlyTimes,HOutForEmpQty,HOutForEmpTimes,HOutForComQty,HOutForComTimes" + + ",HAbsentDays,HRestFlag,HSchClassID,HCTPrjID,HWorkTypeID,HPayMoney,HMoney" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HEmpID.ToString() + "," + oSub.HEmpRate.ToString() + "," + oSub.HPMTimes.ToString() + "," + oSub.HAMTimes.ToString() + "," + oSub.HBaseTimes.ToString() + "," + oSub.HBaseDays.ToString() + + "," + oSub.HOverTimes.ToString() + "," + oSub.HOverDays.ToString() + "," + oSub.HLeaveTimes.ToString() + "," + oSub.HLeaveDays.ToString() + "," + oSub.HLateQty.ToString() + "," + oSub.HLateTimes.ToString() + + "," + oSub.HEarlyQty.ToString() + "," + oSub.HEarlyTimes.ToString() + "," + oSub.HOutForEmpQty.ToString() + "," + oSub.HOutForEmpTimes.ToString() + "," + oSub.HOutForComQty.ToString() + "," + oSub.HOutForComTimes.ToString() + + "," + oSub.HAbsentDays.ToString() + "," + Convert.ToString(oSub.HRestFlag ? 1 : 0) + "," + oSub.HSchClassID.ToString() + "," + oSub.HCTPrjID.ToString() + "," + oSub.HWorkTypeID.ToString() + "," + oSub.HPayMoney.ToString() + "," + oSub.HMoney.ToString() + + ") "); + } + // + //foreach (Models.ClsPay_WorkTimesBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Pay_WorkTimesBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏂板鍗曟嵁 + public override bool AddBill(ref string sReturn) + { + try + { + //寰楀埌mainid + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCn.BeginTran(); + //涓昏〃 + oCn.RunProc("Insert Into Pay_WorkTimesBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HDeptID,HGroupID,HPayType,HSaveType" + + ") " + + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + + ", " + omodel.HDeptID.ToString() + "," + omodel.HGroupID.ToString() + ",'" + omodel.HPayType + "'," + DBUtility.ClsPub.BoolToString(omodel.HSaveType) + + ") "); + //鎻掑叆瀛愯〃 + foreach (Models.ClsPay_WorkTimesBillSub oSub in DetailColl) + { + oCn.RunProc("Insert into Pay_WorkTimesBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HEmpID,HEmpRate,HPMTimes,HAMTimes,HBaseTimes,HBaseDays" + + ",HOverTimes,HOverDays,HLeaveTimes,HLeaveDays,HLateQty,HLateTimes" + + ",HEarlyQty,HEarlyTimes,HOutForEmpQty,HOutForEmpTimes,HOutForComQty,HOutForComTimes" + + ",HAbsentDays,HRestFlag,HSchClassID,HCTPrjID,HWorkTypeID,HPayMoney,HMoney" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + + "," + oSub.HEmpID.ToString() + "," + oSub.HEmpRate.ToString() + "," + oSub.HPMTimes.ToString() + "," + oSub.HAMTimes.ToString() + "," + oSub.HBaseTimes.ToString() + "," + oSub.HBaseDays.ToString() + + "," + oSub.HOverTimes.ToString() + "," + oSub.HOverDays.ToString() + "," + oSub.HLeaveTimes.ToString() + "," + oSub.HLeaveDays.ToString() + "," + oSub.HLateQty.ToString() + "," + oSub.HLateTimes.ToString() + + "," + oSub.HEarlyQty.ToString() + "," + oSub.HEarlyTimes.ToString() + "," + oSub.HOutForEmpQty.ToString() + "," + oSub.HOutForEmpTimes.ToString() + "," + oSub.HOutForComQty.ToString() + "," + oSub.HOutForComTimes.ToString() + + "," + oSub.HAbsentDays.ToString() + "," + Convert.ToString(oSub.HRestFlag ? 1 : 0) + "," + oSub.HSchClassID.ToString() + "," + oSub.HCTPrjID.ToString() + "," + oSub.HWorkTypeID.ToString() + "," + oSub.HPayMoney.ToString() + "," + oSub.HMoney.ToString() + + ") "); + } + // + //foreach (Models.ClsPay_WorkTimesBillSub oSub in DetailColl) + //{ + // Ds = oCn.RunProcReturn("exec h_p_Pay_WorkTimesBill_Qty " + oSub.HICMOInterID, ""); + // if (Ds.Tables[0].Rows.Count == 0) + // return; + // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") + // { + // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; + // return false; + // } + //} + // + sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + oCn.Commit(); + return true; + } + catch (Exception e) + { + sReturn = e.Message; + oCn.RollBack(); + throw (e); + } + } + //鏄剧ず鍗曟嵁 + public override bool ShowBill(Int64 lngBillKey, ref string sReturn) + { + try + { + //鏌ヨ涓昏〃 + DataSet Ds ; + Ds = oCn.RunProcReturn("Select * from Pay_WorkTimesBillMain Where HInterID=" + lngBillKey.ToString(), "Pay_WorkTimesBillMain"); + if(Ds.Tables[0].Rows.Count==0) + { + sReturn = "鍗曟嵁鏈壘鍒帮紒"; + return false; + } + //鍥哄畾璧嬪��=========================================== + omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); + omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); + omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); + omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); + omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); + omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); + omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); + omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); + omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); + omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); + omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); + omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); + omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); + omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); + omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); + omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); + omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); + omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); + omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); + omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); + omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); + omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); + omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); + omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); + omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); + //======================================================== + omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); + omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]); + omodel.HPayType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPayType"]); + omodel.HSaveType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HSaveType"]); + // + + //寰幆 + DataSet DsSub ; + DsSub = oCn.RunProcReturn("Select * from Pay_WorkTimesBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Pay_WorkTimesBillSub"); + DetailColl.Clear();//娓呯┖ + for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) + { + Models.ClsPay_WorkTimesBillSub oSub = new Models.ClsPay_WorkTimesBillSub(); + // 鍥哄畾璧嬪��=============================================== + oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); + oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); + oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); + oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); + oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); + oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); + oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); + oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); + oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); + oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); + oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); + oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); + //=================================================== + oSub.HEmpID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEmpID"]); + oSub.HEmpRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HEmpRate"]); + oSub.HPMTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPMTimes"]); + oSub.HAMTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HAMTimes"]); + oSub.HBaseTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBaseTimes"]); + oSub.HBaseDays = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBaseDays"]); + oSub.HOverTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOverTimes"]); + oSub.HOverDays = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOverDays"]); + oSub.HLeaveTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HLeaveTimes"]); + oSub.HLeaveDays = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HLeaveDays"]); + oSub.HLateQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HLateQty"]); + oSub.HLateTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HLateTimes"]); + oSub.HEarlyQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEarlyQty"]); + oSub.HEarlyTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HEarlyTimes"]); + oSub.HOutForEmpQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HOutForEmpQty"]); + oSub.HOutForEmpTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOutForEmpTimes"]); + oSub.HOutForComQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HOutForComQty"]); + oSub.HOutForComTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOutForComTimes"]); + oSub.HAbsentDays = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HAbsentDays"]); + oSub.HRestFlag = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HRestFlag"]); + oSub.HSchClassID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSchClassID"]); + oSub.HCTPrjID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HCTPrjID"]); + oSub.HWorkTypeID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkTypeID"]); + oSub.HPayMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPayMoney"]); + oSub.HMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HMoney"]); + DetailColl.Add(oSub); + } + sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�"; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + + } + +} diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index 2db5d75..d01d267 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -1843,5 +1843,41 @@ List<Models.ClsOA_ErrMsgBackBillSub2> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsOA_ErrMsgBackBillSub2>>(jsonString); return list; } + + #region 宸ヨ祫璁$畻鍗� 闆嗕綋 + public List<Models.ClsPay_GroupBalBillMain> getObjectByJson_Pay_GroupBalBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsPay_GroupBalBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_GroupBalBillMain>>(jsonString); + return list; + } + public List<Models.ClsPay_GroupBalBillSub> getObjectByJson_Pay_GroupBalBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsPay_GroupBalBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_GroupBalBillSub>>(jsonString); + return list; + } + public List<Models.ClsPay_GroupBalBillEmp> getObjectByJson_Pay_GroupBalBillEmp(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsPay_GroupBalBillEmp> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_GroupBalBillEmp>>(jsonString); + return list; + } + #endregion + + #region 鑰冨嫟姹囨姤鍗� + public List<Models.ClsPay_WorkTimesBillMain> getObjectByJson_Pay_WorkTimesBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsPay_WorkTimesBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_WorkTimesBillMain>>(jsonString); + return list; + } + public List<Models.ClsPay_WorkTimesBillSub> getObjectByJson_Pay_WorkTimesBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Models.ClsPay_WorkTimesBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_WorkTimesBillSub>>(jsonString); + return list; + } + #endregion } } \ No newline at end of file diff --git "a/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBillMain.cs" "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBillMain.cs" new file mode 100644 index 0000000..1e329fe --- /dev/null +++ "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBillMain.cs" @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebAPI.Models +{ + public class ClsPay_WorkTimesBillMain:DBUtility.ClsXt_BaseBillMain + { + public Int64 HDeptID;// int + public Int64 HGroupID;// int ’班组 + public string HPayType;// varchar(50) '工资类型 界面不显示 存‘’ + public bool HSaveType;// bit '保存类型 + } +} diff --git "a/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBillSub.cs" "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBillSub.cs" new file mode 100644 index 0000000..78556d1 --- /dev/null +++ "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_WorkTimesBillSub.cs" @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebAPI.Models +{ + public class ClsPay_WorkTimesBillSub:DBUtility.ClsXt_BaseBillSub + { + public DateTime HEntryCloseDate;// datetime --行关闭 (默认为'') new + public string HRemark;// varchar(200) --备注 + public Int64 HEmpID;// int '职员 + public Single HEmpRate;// money '职员系数 + public Single HPMTimes;// money '下午工时 + public Single HAMTimes;// money '上午工时 + public Single HBaseTimes;// money '基本工时 + public Single HBaseDays;// money '基本天数 + public Single HOverTimes;// money '加班工时 + public Single HOverDays;// money '加班天数 + public Single HLeaveTimes;// money '请假工时 + public Single HLeaveDays;// money '请假天数 + public Int64 HLateQty;// int '迟到次数 + public Single HLateTimes;// money '迟到时间 + public Int64 HEarlyQty;// int '早退次数 + public Single HEarlyTimes;// money '早退时间 + public Int64 HOutForEmpQty;// int '私出次数 + public Single HOutForEmpTimes;// money '私出时间 + public Int64 HOutForComQty;// int ’公出次数 + public Single HOutForComTimes;// money '公出时间 + public Int64 HAbsentDays;// int ‘旷工天数 + public bool HRestFlag;// bit '厂休 + public Int64 HSchClassID;// int '班次 暂时存0 + public Int64 HCTPrjID;// int '核算方案 + public Int64 HWorkTypeID;// int //工种 + public Single HPayMoney;// money //小时工资 + public Single HMoney;// money //工资 + } +} diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index 64c2ae3..2418e11 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -352,7 +352,7 @@ <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_GroupBalBillController.cs" /> <Compile Include="Controllers\PurchaseOrderController.cs" /> <Compile Include="Controllers\QC_POStockInCheckBillController.cs" /> - <Compile Include="Controllers\Pay_WorkTimesBillController.cs" /> + <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_WorkTimesBillController.cs" /> <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_SingleBalBillController.cs" /> <Compile Include="Controllers\ProductionOrderController.cs" /> <Compile Include="Controllers\PublicPageMethodController.cs" /> @@ -447,6 +447,7 @@ <Compile Include="DLL\ClsSc_MouldOtherInBill.cs" /> <Compile Include="DLL\ClsSc_MouldMoveStockStepOutBill.cs" /> <Compile Include="DLL\宸ヨ祫绠$悊\ClsPay_GroupBalBill.cs" /> + <Compile Include="DLL\宸ヨ祫绠$悊\ClsPay_WorkTimesBill.cs" /> <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_GroupBalBillEmp.cs" /> <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_GroupBalBillMain.cs" /> <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_GroupBalBillSub.cs" /> @@ -611,6 +612,8 @@ <Compile Include="Models\鍩虹璧勬枡\Gy_Process.cs" /> <Compile Include="Models\鍩虹璧勬枡\Gy_ClassTimePrj.cs" /> <Compile Include="Models\鍩虹璧勬枡\Warehouse.cs" /> + <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_WorkTimesBillMain.cs" /> + <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_WorkTimesBillSub.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> -- Gitblit v1.9.1