| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | public DAL.ClsPay_WorkTimesBill oBill = new DAL.ClsPay_WorkTimesBill(); |
| | | public DAL.ClsPay_WorkTimesBill BillNew = new DAL.ClsPay_WorkTimesBill(); //对åºåæ®ç±» |
| | | public DAL.ClsPay_WorkTimesBill BillOld = new DAL.ClsPay_WorkTimesBill(); //对åºåæ®ç±» |
| | | public DLL.ClsPay_WorkTimesBill BillNew0 = new DLL.ClsPay_WorkTimesBill(); // |
| | | public DLL.ClsPay_WorkTimesBill BillOld0 = new DLL.ClsPay_WorkTimesBill(); // |
| | | |
| | | |
| | | #region è夿±æ¥åå表 |
| | | #region è夿±æ¥ååè¡¨ä¿¡æ¯ |
| | | /// <summary> |
| | | /// è·åè夿±æ¥ååè¡¨ä¿¡æ¯ |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region è夿±æ¥åç¼è¾ |
| | | #region è夿±æ¥å模å ä»å表é䏿å¼åæ®ï¼è¿ååæ®ä¿¡æ¯æ¶è°ç¨ |
| | | /// <summary> |
| | | /// è夿±æ¥åç¼è¾æ¶ï¼æ ¹æ®åæ®IDè·ååæ®ä¿¡æ¯ |
| | | /// </summary> |
| | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region è夿±æ¥åä¿å |
| | | /// <summary> |
| | | /// è夿±æ¥åä¿å |
| | | /// </summary> |
| | | [Route("Pay_WorkTimesBillController/GetPay_WorkTimesBill_Save_Json")] |
| | | [HttpPost] |
| | | public object GetPay_WorkTimesBill_Save_Json([FromBody] JObject sMainSub) |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string sMainStr = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string sSubStr = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | string OperationType = sArray[2].ToString(); //æä½ç±»åï¼1æ°å¢ã2ç¼è¾ï¼ |
| | | string HMaker = sArray[3].ToString(); //å¶å人 |
| | | try |
| | | { |
| | | //夿æé |
| | | if (OperationType == "1") |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; |
| | | //夿æ°å¢æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HMaker)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæ°å¢æé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify; |
| | | //夿ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //表头èµå¼ |
| | | sMainStr = sMainStr.Replace("\\", ""); |
| | | sMainStr = sMainStr.Replace("\n", ""); |
| | | sMainStr = "[" + sMainStr.ToString() + "]"; |
| | | List<Model.ClsPay_WorkTimesBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_WorkTimesBillMain>>(sMainStr); |
| | | foreach (Model.ClsPay_WorkTimesBillMain oItem in lsmain) |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å
许ä¿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod_Pay(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oItem.HYear = sYear; |
| | | oItem.HPeriod = sPeriod; |
| | | DBUtility.ClsPub.CurUserName = oItem.HMaker; |
| | | oBill.omodel = oItem; |
| | | } |
| | | //表ä½èµå¼ |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | sSubStr = sSubStr.Substring(1, sSubStr.Length - 2); |
| | | sSubStr = sSubStr.Replace("\\", ""); |
| | | sSubStr = sSubStr.Replace("\n", ""); |
| | | sSubStr = "[" + sSubStr.ToString() + "]"; |
| | | List<Model.ClsPay_WorkTimesBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_WorkTimesBillSub>>(sSubStr); |
| | | int i = 0; |
| | | foreach (Model.ClsPay_WorkTimesBillSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oBill.DetailColl.Add(oItemSub); |
| | | } |
| | | |
| | | //ä¿å |
| | | bool bResult; |
| | | if (OperationType == "1") //æ°å¢ä¿å |
| | | { |
| | | 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 = DBUtility.ClsPub.sExeReturnInfo; //æåï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //---------------------------------------------------------------------------------------------æ§æ¹æ³ |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¿åè夿±æ¥åå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Pay_WorkTimesBill/GetWorkTimesBill")] |
| | | [HttpGet] |
| | | public object GetWorkTimesBill(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Pay_WorkTimesBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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 hmainid desc", "h_v_Pay_WorkTimesBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Pay_WorkTimesBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_WorkTimesBillList"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | #region[è夿±æ¥åç¼è¾æ¶è·åè¡¨å¤´æ°æ®] |
| | |
| | | #region[è夿±æ¥åç¼è¾æ¶è·åè¡¨ä½æ°æ®] |
| | | [Route("Pay_WorkTimesBill/Pay_WorkTimesBillListProjectDetai")] |
| | | [HttpGet] |
| | | public object Pay_WorkTimesBillListProjectDetai(Int64 HInterID) |
| | | public object Pay_WorkTimesBillListProjectDetai(string sqlWhere) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Pay_WorkTimesBill_EditInit " + HInterID, "h_p_Pay_WorkTimesBill_EditInit"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°è¯¥è夿±æ¥åï¼è¯·å·æ°æ°æ®åéæ°éæ©ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql1 = "SELECT HDeptID,é¨é¨ä»£ç ,é¨é¨,HGroupID" + |
| | | ",çç»ä»£ç ,çç»,è¡¨å¤´å¤æ³¨,å¶å人,å¶åæ¥æ,å®¡æ ¸äºº" + |
| | | ",å®¡æ ¸æ¥æ,ä¿®æ¹äºº,ä¿®æ¹æ¥æ,å
³é人, å
³éæ¥æ,HEmpID" + |
| | | ",HEmpNumber,HEmpName,èåç³»æ° HEmpRate,åºæ¬å¤©æ° HBaseDays,åºæ¬å·¥æ¶ HBaseTimes,å çå·¥æ¶ HOverTimes,请åå·¥æ¶ HLeaveTimes,å çå¤©æ° HOverDays,请åå¤©æ° HLeaveDays,è¿å°æ¬¡æ° HLateQty" + |
| | | ",å
¬åº HOutForComQty,ç§åº HOutForEmpQty,å
¬åºæ¶é´ HOutForComTimes,ç§åºæ¶é´ HOutForEmpTimes,è¿å°æ¶é´ HLateTimes,æ©éæ¬¡æ° HEarlyQty,æ©éæ¶é´ HEarlyTimes" + |
| | | ",æ·å·¥å¤©æ° 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"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¿åè夿±æ¥åä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (BillOld.ShowBill(oItem.HInterID, ref s) == false) |
| | | if (BillOld0.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) |
| | | if (BillOld0.omodel.HChecker != "" && BillOld0.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.omodel.HBillStatus > 1) |
| | | if (BillOld0.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld0, ref s)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | ///å·¥èµç»ç®ä¸ªäººåå é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Pay_WorkTimesBill/DeltetWorkTimesBill")] |
| | | [HttpGet] |
| | | public object DeltetWorkTimesBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Pay_WorkTimesBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éè¿çç»æ¥è¯¢èåä¿¡æ¯ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |