| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | public DAL.ClsQC_ProcessCheckBill BillOld = new DAL.ClsQC_ProcessCheckBill(); |
| | | DataSet ds; |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | |
| | | #region å·¥åºæ£éªåå表 |
| | | [Route("QC_ProcessCheckBill/QC_ProcessCheckBillList")] |
| | | [HttpGet] |
| | | public object QC_ProcessCheckBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = "select * from h_v_QC_ProcessCheckBill where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by å¶åæ¥æ desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBill"); |
| | | |
| | | //æ·»å åå |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥è¯¢å°æ°æ®"; |
| | | objJsonResult.list = columnNameList; |
| | | 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 å·¥åºæ£éªåå表2 åªè·åè¡¨å¤´æ°æ®ï¼ä¸åæç»è¡ä¿¡æ¯ |
| | | [Route("QC_ProcessCheckMainBill/QC_ProcessCheckMainBillList")] |
| | | [HttpGet] |
| | | public object QC_ProcessCheckMainBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Query", 3, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql1 = "select * from h_v_QC_ProcessCheckBillMainList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by å¶åæ¥æ desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillMainList"); |
| | | |
| | | //æ·»å åå |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥è¯¢å°æ°æ®"; |
| | | objJsonResult.list = columnNameList; |
| | | 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 å·¥åºæ£éªåå页å表 |
| | | [Route("QC_ProcessCheckMainBill/QC_ProcessCheckMainBillListPage")] |
| | | [HttpGet] |
| | | public object QC_ProcessCheckMainBillListPage(string sWhere, string user, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("QC_ProcessCheckBill_Query", 3, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_QC_ProcessCheckMainBillListPage " + page + "," + size + ",''", "h_p_QC_ProcessCheckMainBillListPage"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_QC_ProcessCheckMainBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_ProcessCheckMainBillListPage"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | 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 å·¥åºæ£éªåç¼è¾æ¥è¯¢æ°æ® |
| | | [Route("QC_ProcessCheckBill/QC_ProcessCheckBill_Edit")] |
| | | [HttpGet] |
| | | public object QC_ProcessCheckBill_Edit(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = "select * from h_v_QC_ProcessCheckBill_Edit where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc,HSNO asc,hsubid"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBill_Edit"); |
| | | |
| | | //æ·»å åå |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥è¯¢å°æ°æ®"; |
| | | objJsonResult.list = columnNameList; |
| | | 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 å·¥åºæ£éªå å®¡æ ¸ åå®¡æ ¸ å
³é åå
³é ä½åº åä½åº |
| | | /// <summary> |
| | | /// å·¥åºæ£éªå å®¡æ ¸ãåå®¡æ ¸ |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("QC_ProcessCheckBill/QC_ProcessCheckBillMainValue")] |
| | | [HttpGet] |
| | | public object QC_ProcessCheckBillMainValue(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("QC_ProcessCheckBill_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from QC_ProcessCheckBillMain where HInterID=" + HInterID, "QC_ProcessCheckBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | //å®¡æ ¸åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_QC_ProcessCheckBill_BeforeCheckCtrl "); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("update QC_ProcessCheckBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | DataSet EndDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_AfterCheckCtrl " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + CurUserName + "'", "h_p_QC_ProcessCheckBill_AfterCheckCtrl"); |
| | | if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_QC_ProcessCheckBill_BeforeUnCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("update QC_ProcessCheckBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | DataSet EndDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_AfterUnCheckCtrl " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + CurUserName + "'", " h_p_QC_ProcessCheckBill_AfterUnCheckCtrl"); |
| | | if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·¥åºæ£éªå å
³é åå
³é |
| | | /// </summary> |
| | | /// <param name="HInterID"></param> |
| | | /// <param name="Type"></param> |
| | | /// <param name="user"></param> |
| | | /// <returns></returns> |
| | | [Route("QC_ProcessCheckBill/CloseQC_ProcessCheckBillMain")] |
| | | [HttpGet] |
| | | public object CloseQC_ProcessCheckBillMain(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "QC_ProcessCheckBillMain"; |
| | | DAL.ClsQC_ProcessCheckBill oBill = new DAL.ClsQC_ProcessCheckBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (Type == 1) //å
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½å次å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (Type == 2) //åå
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå
³é!ä¸éè¦åå
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¿è¡éè¦è¿è¡çå
³é/åå
³éæä½ |
| | | if (Type == 1) //å
³éæäº¤ |
| | | { |
| | | //å
³éåæ§å¶========================================= |
| | | string sql1 = "exec h_p_QC_ProcessCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_QC_ProcessCheckBill_BeforeCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³é失败!åå :å
³éåå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | //å
³éæäº¤ |
| | | if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_ProcessCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (Type == 2) //åå
³éæäº¤ |
| | | { |
| | | //åå
³éåæ§å¶========================================= |
| | | string sql1 = "exec h_p_QC_ProcessCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_QC_ProcessCheckBill_BeforeUnCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³é失败!åå :åå
³éåå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | //åå
³éæäº¤ |
| | | if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_ProcessCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å·¥åºæ£éªå ä½åº åä½åº |
| | | /// </summary> |
| | | /// <param name="HInterID"></param> |
| | | /// <param name="Type"></param> |
| | | /// <param name="user"></param> |
| | | /// <returns></returns> |
| | | [Route("QC_ProcessCheckBill/DropQC_ProcessCheckBillMain")] |
| | | [HttpGet] |
| | | public object DropQC_ProcessCheckBillMain(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æä½åºæé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "QC_ProcessCheckBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 ä½åº 2 åä½åº |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»ä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //ä½åºåæ® |
| | | if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åä½åºåæ® |
| | | if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥åºæ£éªåå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("QC_ProcessCheckBill/GetProcessCheckBillList")] |
| | | [HttpGet] |
| | | public object GetProcessCheckBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_QC_ProcessCheckBillListDetail order by hmainid desc ", "h_v_QC_ProcessCheckBillListDetail"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_QC_ProcessCheckBillListDetail where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillListDetail"); |
| | | } |
| | | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | |
| | | #region å·¥åºæ£éªåä¿å |
| | | /// <summary> |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string OperationType = sArray[2].ToString().Trim(); |
| | | string user = sArray[3].ToString();//ç¨æ·å |
| | | |
| | | bool bResult; |
| | | try |
| | | { |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Model.ClsQC_ProcessCheckBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillMain>>(msg2); |
| | | DAL.ClsQC_ProcessCheckBill BillNew = new DAL.ClsQC_ProcessCheckBill(); |
| | |
| | | BillNew.omodel.HICMOInterID = ClsPub.isLong(mainList[0].HICMOInterID); |
| | | BillNew.omodel.HICMOBillNo = ClsPub.isStrNull(mainList[0].HICMOBillNo); |
| | | BillNew.omodel.HICMOEntryID = ClsPub.isLong(mainList[0].HICMOEntryID); |
| | | BillNew.omodel.HICMOQty = ClsPub.isLong(mainList[0].HICMOQty); |
| | | BillNew.omodel.HProcExchInterID = ClsPub.isLong(mainList[0].HProcExchInterID); |
| | | BillNew.omodel.HProcExchEntryID = ClsPub.isLong(mainList[0].HProcExchEntryID); |
| | | BillNew.omodel.HProcExchBillNo = ClsPub.isStrNull(mainList[0].HProcExchBillNo); |
| | | BillNew.omodel.HProcExchQty = ClsPub.isLong(mainList[0].HProcExchQty); |
| | | BillNew.omodel.HMaterID = ClsPub.isLong(mainList[0].HMaterID); |
| | | BillNew.omodel.HFirstCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); |
| | | BillNew.omodel.HCheckerResult = ClsPub.isStrNull(mainList[0].HCheckerResult); |
| | |
| | | BillNew.omodel.HMainSourceEntryID = ClsPub.isLong(mainList[0].HMainSourceEntryID); |
| | | BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo); |
| | | BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType); |
| | | BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID); |
| | | BillNew.omodel.HBillStatus = 1; |
| | | BillNew.omodel.HProcID = ClsPub.isLong(mainList[0].HProcID); |
| | | BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID); |
| | | BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment); |
| | | BillNew.omodel.HBatchNo = ClsPub.isStrNull(mainList[0].HBatchNo); |
| | | BillNew.omodel.HTakeSampleCheckBillID = ClsPub.isLong(mainList[0].HTakeSampleCheckBillID); |
| | | BillNew.omodel.HTakeSampleCheckBillNo = ClsPub.isStrNull(mainList[0].HTakeSampleCheckBillNo); |
| | | List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg3); |
| | | BillNew.DetailColl = new List<Model.ClsQC_ProcessCheckBillSub>(); |
| | | for (int i = 0; i < subList.ToArray().Length; i++) |
| | |
| | | oSub.HProcCheckTime = HDate; |
| | | oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); |
| | | oSub.HProcCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); |
| | | |
| | | oSub.HSampleSchemeID = DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID); |
| | | oSub.HSampleQty = DBUtility.ClsPub.isLong(subList[i].HSampleQty); |
| | | oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty); |
| | | oSub.HAcceptQty = DBUtility.ClsPub.isLong(subList[i].HAcceptQty); |
| | | oSub.HRejectQty = DBUtility.ClsPub.isLong(subList[i].HRejectQty); |
| | | oSub.HSampleUnRightQty = DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty); |
| | | oSub.HStatus = DBUtility.ClsPub.isStrNull(subList[i].HStatus); |
| | | oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitID); |
| | | oSub.HInspectVal = DBUtility.ClsPub.isStrNull(subList[i].HInspectVal); |
| | | oSub.HTargetVal = DBUtility.ClsPub.isStrNull(subList[i].HTargetVal); |
| | | oSub.HUpLimit = DBUtility.ClsPub.isStrNull(subList[i].HUpLimit); |
| | | oSub.HDownLimit = DBUtility.ClsPub.isStrNull(subList[i].HDownLimit); |
| | | oSub.HQCNote = DBUtility.ClsPub.isStrNull(subList[i].HQCNote); |
| | | oSub.HUpOffSet = DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet); |
| | | oSub.HDownOffSet = DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet); |
| | | oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod); |
| | | oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect); |
| | | oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID); |
| | | oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult); |
| | | |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å·¥åºæ£éªåæ ¹æ®æºåç±»åè·åä¿¡æ¯-æºå为çäº§ç¶æä¸´æ¶è¡¨ï¼3722ï¼ |
| | | /// <summary> |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("QC_ProcessCheckBill/get_ICMOBillStatus_Tmp")] |
| | | [HttpGet] |
| | | public object get_ICMOBillStatus_Tmp(int HInterID, int HEntryID, string HBillType) |
| | | #region æ£éªå¼ä¿å |
| | | [Route("QC_ProcessCheckBill/set_SaveValue")] |
| | | [HttpPost] |
| | | public object set_SaveValue([FromBody] JObject msg) |
| | | { |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | if (HInterID == 0 || HBillType.Equals("")) |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | |
| | | string Value = sArray[0].ToString(); //æ£éªå¼è¡¨æ ¼ |
| | | Int64 HInterID = Convert.ToInt64(sArray[1]); //主ID |
| | | Int64 HEntryID = Convert.ToInt64(sArray[2]); //åID |
| | | bool bResult; |
| | | |
| | | |
| | | List<Model.ClsQC_ProcessCheckBillSub_ValueGrid> valueList = new List<Model.ClsQC_ProcessCheckBillSub_ValueGrid>(); |
| | | valueList = oListModels.getObjectByJson_ClsQC_ProcessCheckBillSub_ValueGrid(Value); |
| | | |
| | | DAL.ClsQC_ProcessCheckBill BillNew = new DAL.ClsQC_ProcessCheckBill(); |
| | | |
| | | for (int i = 0; i < valueList.ToArray().Length; i++) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ°ä¸å
¨ï¼è·åæºåä¿¡æ¯å¤±è´¥ï¼HInterIDï¼" + HInterID + "ï¼HEntryIDï¼" + HEntryID + "ï¼HBillTypeï¼" + HBillType + "ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | if (i >= 0)//HQty |
| | | { |
| | | Model.ClsQC_ProcessCheckBillSub_ValueGrid oSub_Value = new Model.ClsQC_ProcessCheckBillSub_ValueGrid(); |
| | | oSub_Value.HInterID = HInterID; |
| | | oSub_Value.HEntryID = HEntryID; |
| | | oSub_Value.HSEQ = i + 1; |
| | | oSub_Value.HInSpectResult = ClsPub.isStrNull(valueList[i].HInSpectResult); |
| | | oSub_Value.HInSpectValue = ClsPub.isDoule(valueList[i].HInSpectValue); |
| | | oSub_Value.HInSpectValueB = ClsPub.isLong(valueList[i].HInSpectValueB); |
| | | oSub_Value.HInSpectValueT = ClsPub.isStrNull(valueList[i].HInSpectValueT); |
| | | |
| | | BillNew.DetailColl_Value.Add(oSub_Value); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æç»è¡ä¿¡æ¯!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_QC_GetInfoByICMOStatusBill " + HInterID + "," + HEntryID + "," + HBillType, "h_p_QC_GetInfoByICMOStatusBill"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | |
| | | bResult = BillNew.AddValue(ref ClsPub.sExeReturnInfo, ref HInterID, ref HEntryID); |
| | | |
| | | if (bResult == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.Message = "ä¿åæ£éªå¼æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + e.ToString(); |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region å·¥åºæ£éªåOld |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Route("QC_ProcessCheckBill/Delete_Json")] |
| | | [HttpGet] |
| | | public object Delete_Json(long HItemID) |
| | | public object Delete_Json(long HItemID,string user) |
| | | { |
| | | DAL.ClsQC_ProcessCheckBill BillOld = new DAL.ClsQC_ProcessCheckBill(); |
| | | try |
| | | { |
| | | if (BillOld.DeleteBill(HItemID, ref ClsPub.sExeReturnInfo) != true) |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Delete", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | var ds = oCN.RunProcReturn("select * from QC_ProcessCheckBillMain where HInterID=" + HItemID, "QC_ProcessCheckBillMain"); |
| | | //å é¤åæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_BeforeDelCtrl " + HItemID.ToString() + ",'" + user + "'", "h_p_QC_ProcessCheckBill_BeforeDelCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | if (BillOld.DeleteBill(HItemID, ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_QC_ProcessCheckBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo) != true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥åºæ£éªåå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | ///è¿åæ£éªå¼å表 |
| | | /// </summary> |
| | | [Route("QC_ProcessCheckBill/GetProcessCheckBillList")] |
| | | /// <param name="sWhere"></param> |
| | | /// <returns></returns> |
| | | [Route("QC_ValueTable_ProcessCheck/getValueList")] |
| | | [HttpGet] |
| | | public object GetProcessCheckBillList(string sWhere) |
| | | public object getValueList(Int64 HInterID, Int64 HEntryID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_QC_ProcessCheckBillListDetail " + sWhere, "h_v_QC_ProcessCheckBillListDetail"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_QC_ProcessCheckBillListDetail where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillListDetail"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from QC_ProcessCheckBillSub_ValueGrid where HInterID=" + HInterID + " and HEntryID=" + HEntryID, "QC_ProcessCheckBillSub_ValueGrid"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥è¯¢å°æ°æ®ï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region é¦ä»¶æ£éªåæ ¹æ®æºåç±»åè·åä¿¡æ¯-æºå为工åºåºç«å |
| | | [Route("QC_ProcessCheckBill/get_StationOutBill")] |
| | | [HttpGet] |
| | | public object get_StationOutBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sReturn = ""; |
| | | string sql = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn)) |
| | | { |
| | | switch (oSystemParameter.omodel.QC_ProcessCheckBill_QCSchemeSource) |
| | | { |
| | | case "å·¥åº": |
| | | sql = "exec h_p_QC_ProcessCheck_GetStationOutBillList " + "'å·¥åº','" + HInterID + "'"; |
| | | break; |
| | | case "ç©æ": |
| | | sql = "exec h_p_QC_ProcessCheck_GetStationOutBillList " + "'ç©æ','" + HInterID + "'"; |
| | | break; |
| | | case "å·¥èºè·¯çº¿": |
| | | sql = "exec h_p_QC_ProcessCheck_GetStationOutBillList " + "'å·¥èºè·¯çº¿','" + HInterID + "'"; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | ds = oCN.RunProcReturn(sql, "h_p_QC_ProcessCheck_GetStationOutBillList"); |
| | | |
| | | //æ·»å åå |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | // |
| | | |
| | | #region å·¥åºæ£éªåæ ¹æ®æºåç±»åè·åä¿¡æ¯-æºå为çäº§ç¶æä¸´æ¶è¡¨ï¼3722ï¼ |
| | | /// <summary> |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("QC_ProcessCheckBill/get_ICMOBillStatus_Tmp")] |
| | | [HttpGet] |
| | | public object get_ICMOBillStatus_Tmp(int HInterID, int HEntryID, string HBillType) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sReturn = ""; |
| | | string sql = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn)) |
| | | { |
| | | switch (oSystemParameter.omodel.QC_ProcessCheckBill_QCSchemeSource) |
| | | { |
| | | case "å·¥åº": |
| | | sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'å·¥åº'," + HInterID + "," + HEntryID + "," + HBillType; |
| | | break; |
| | | case "ç©æ": |
| | | sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'ç©æ'," + HInterID + "," + HEntryID + "," + HBillType; |
| | | break; |
| | | case "å·¥èºè·¯çº¿": |
| | | sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'å·¥èºè·¯çº¿'," + HInterID + "," + HEntryID + "," + HBillType; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | ds = oCN.RunProcReturn(sql, "h_p_QC_GetInfoByICMOStatusBill"); |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | //æ·»å åå |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | } |
| | | |
| | | //if (HInterID == 0 || HBillType.Equals("")) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "åæ°ä¸å
¨ï¼è·åæºåä¿¡æ¯å¤±è´¥ï¼HInterIDï¼" + HInterID + "ï¼HEntryIDï¼" + HEntryID + "ï¼HBillTypeï¼" + HBillType + "ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | // ds = oCN.RunProcReturn("exec h_p_QC_GetInfoByICMOStatusBill " + HInterID + "," + HEntryID + "," + HBillType, "h_p_QC_GetInfoByICMOStatusBill"); |
| | | //} |
| | | 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]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |