| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥èµç»ç®å(éä½)模å ä»å表é䏿å¼åæ®ï¼è¿ååæ®ä¿¡æ¯æ¶è°ç¨ |
| | | /// <summary> |
| | | /// å·¥èµç»ç®å(éä½)ç¼è¾æ¶ï¼æ ¹æ®åæ®IDè·ååæ®ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Pay_GroupBalBillController/GetPay_GroupBalBill_Json")] |
| | | [HttpGet] |
| | | public object GetPay_GroupBalBill_Json(Int64 HInterID, string HMaker) |
| | | { |
| | | try |
| | | { |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è¿ååè¡¨ä¿¡æ¯ |
| | | ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBill_EditInit " + HInterID, "h_p_Pay_GroupBalBill_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 = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = new |
| | | { |
| | | Mainlist = ds.Tables[0], //è¿å主表信æ¯ï¼0ï¼ |
| | | Sublist = ds.Tables[1], //è¿åå表1ä¿¡æ¯ï¼1ï¼ |
| | | Emplist = ds.Tables[2], //è¿åå表2ä¿¡æ¯ï¼2ï¼ |
| | | }; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¿åå·¥èµç»ç®å(éä½)ä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥èµç»ç®å(éä½)ä¿å |
| | | /// <summary> |
| | | /// å·¥èµç»ç®å(éä½)ä¿å |
| | | /// </summary> |
| | | [Route("Pay_GroupBalBillController/GetPay_GroupBalBill_Save_Json")] |
| | | [HttpPost] |
| | | public object GetPay_GroupBalBill_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 sSubStr2 = sArray[2].ToString(); //åè¡¨æ°æ®2 |
| | | string OperationType = sArray[3].ToString(); //æä½ç±»åï¼1æ°å¢ã2ç¼è¾ï¼ |
| | | string HMaker = sArray[4].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_GroupBalBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_GroupBalBillMain>>(sMainStr); |
| | | foreach (Model.ClsPay_GroupBalBillMain 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_GroupBalBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_GroupBalBillSub>>(sSubStr); |
| | | int i = 0; |
| | | foreach (Model.ClsPay_GroupBalBillSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oBill.DetailColl.Add(oItemSub); |
| | | } |
| | | //表ä½èµå¼2 |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | sSubStr2 = sSubStr2.Substring(1, sSubStr2.Length - 2); |
| | | sSubStr2 = sSubStr2.Replace("\\", ""); |
| | | sSubStr2 = sSubStr2.Replace("\n", ""); |
| | | sSubStr2 = "[" + sSubStr2.ToString() + "]"; |
| | | List<Model.ClsPay_GroupBalBillEmp> ls2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_GroupBalBillEmp>>(sSubStr2); |
| | | int j = 0; |
| | | foreach (Model.ClsPay_GroupBalBillEmp oItemSub2 in ls2) |
| | | { |
| | | j++; |
| | | oItemSub2.HEntryID = j; |
| | | oBill.DetailEmpColl.Add(oItemSub2); |
| | | } |
| | | |
| | | //ä¿å |
| | | 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 |
| | | |
| | | |
| | | |
| | | |