| | |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | msg3 = sArray[2].ToString(); |
| | | string msg4 = sArray[3].ToString(); |
| | | string msg1 = sArray[0].ToString(); //主表 |
| | | string msg2 = sArray[1].ToString(); //审æ¹é¡¹ç®å表 |
| | | string msg4 = sArray[2].ToString(); //å·¥åºå表 |
| | | string msg5 = sArray[3].ToString(); //æä½ç±»å |
| | | string msg6 = sArray[4].ToString(); //ç¨æ·å |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckFlow_Edit", 1, false, msg4)) |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckFlow_Edit", 1, false, msg6)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | List<Models.Xt_CheckFlowSub> lsmain = new List<Models.Xt_CheckFlowSub>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain =JsonConvert.DeserializeObject<List<Xt_CheckFlowSub>>(msg2); |
| | | lsmain = JsonConvert.DeserializeObject<List<Xt_CheckFlowSub>>(msg2); |
| | | foreach (Xt_CheckFlowSub oItem in lsmain) |
| | | { |
| | | if (oItem.HCheckItemID == 0) |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å·¥åºåè¡¨æ°æ® |
| | | List<Models.Xt_CheckFlowSub_Proc> lsProc = new List<Models.Xt_CheckFlowSub_Proc>(); |
| | | if (!string.IsNullOrEmpty(msg4) && msg4 != "[]") |
| | | { |
| | | msg4 = msg4.Replace("\\", ""); |
| | | msg4 = msg4.Replace("\n", ""); |
| | | lsProc = JsonConvert.DeserializeObject<List<Xt_CheckFlowSub_Proc>>(msg4); |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Xt_CheckFlowList where Hmainid= " + main.HInterID, "h_v_Xt_CheckFlowList"); |
| | | //ä¿ååæ§å¶å¤æ |
| | | string sql = "select * from Xt_CheckFlowMain where HBillTypeID = '" + main.HBillTypeID.ToString() + "' and HDeptID = " + main.HDeptID.ToString() + " and HStandard = 1 and HInterID <> "+ main.HInterID.ToString(); |
| | | string sql = "select * from Xt_CheckFlowMain where HBillTypeID = '" + main.HBillTypeID.ToString() + "' and HDeptID = " + main.HDeptID.ToString() + " and HStandard = 1 and HInterID <> " + main.HInterID.ToString(); |
| | | DataSet ds2 = oCN.RunProcReturn(sql, "Xt_CheckFlowMain"); |
| | | if (ds2.Tables[0].Rows.Count > 0 && main.HStandard) |
| | | { |
| | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | oCN.BeginTran(); |
| | | if (msg3 == "1" && ds.Tables[0].Rows.Count == 0) |
| | | if (msg5 == "1" && ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | oCN.RunProc("Insert Into Xt_CheckFlowMain " + |
| | | "(HBillTypeID,HInterID,HDeptID" + |
| | |
| | | " where HInterID=" + main.HInterID.ToString()); |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Xt_CheckFlowSub where HInterID=" + main.HInterID.ToString()); |
| | | //å é¤å·¥åºå表 |
| | | oCN.RunProc("delete from Xt_CheckFlowSub_Proc where HInterID=" + main.HInterID.ToString()); |
| | | } |
| | | AddBillSub(lsmain, main.HInterID); |
| | | //ä¿åå·¥åºå表 |
| | | AddBillProcSub(lsProc, main.HInterID); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //ä¿åå·¥åºå表 |
| | | public json AddBillProcSub(List<Xt_CheckFlowSub_Proc> DetailColl, long HInterID) |
| | | { |
| | | int i = 1; |
| | | foreach (Xt_CheckFlowSub_Proc oSub in DetailColl) |
| | | { |
| | | oCN.RunProc("Insert into Xt_CheckFlowSub_Proc " + |
| | | " (HInterID,HEntryID,HProcID,HRemark" + |
| | | " )values(" |
| | | + HInterID + "," + i + "," + oSub.HProcID + ",'" + oSub.HRemark + "') "); |
| | | i++; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å·¥åºå表æ¥è¯¢ |
| | | [Route("Xt_CheckFlowBill/Xt_CheckFlowProcList")] |
| | | [HttpGet] |
| | | public object Xt_CheckFlowProcList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format(@"select a.HInterID,a.HEntryID,a.HProcID,b.HNumber as å·¥åºä»£ç ,b.HName as å·¥åº,a.HRemark as 夿³¨ |
| | | from Xt_CheckFlowSub_Proc a |
| | | left join Gy_Process b on a.HProcID = b.HItemID |
| | | where 1=1 "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by a.HEntryID", "Xt_CheckFlowSub_Proc"); |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸æµç¨å å é¤ |