| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | |
| | | #region é¦ä»¶æ£éªåå表 |
| | | [Route("QC_FirstPieceCheckBill/QC_FirstPieceCheckBillList")] |
| | | [HttpGet] |
| | | public object QC_FirstPieceCheckBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = "select * from h_v_QC_FirstPieceCheckBill where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBill"); |
| | | |
| | | //æ·»å åå |
| | | 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_FirstPieceCheckBill/set_SaveBill")] |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region é¦ä»¶æ£éªåæ ¹æ®æºåç±»åè·åä¿¡æ¯-æºå为çäº§ç¶æä¸´æ¶è¡¨ï¼3722ï¼ |
| | | /// <summary> |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("QC_FirstPieceCheckBill/get_ICMOBillStatus_Tmp")] |
| | | [HttpGet] |
| | | public object get_ICMOBillStatus_Tmp(int HInterID,int HEntryID,string HBillType) |
| | | { |
| | | try |
| | | { |
| | | 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]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region æ£éªå¼ä¿å |
| | | [Route("QC_FirstPieceCheckBill/set_SaveValue")] |
| | |
| | | } |
| | | } |
| | | |
| | | #region é¦ä»¶æ£éªåå表 |
| | | [Route("QC_FirstPieceCheckBill/QC_FirstPieceCheckBillList")] |
| | | /// <summary> |
| | | /// é¦ä»¶æ£éªé»è¾å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetQC_FirstPieceCheck")] |
| | | [HttpGet] |
| | | public object QC_FirstPieceCheckBillList(string sWhere, string user) |
| | | public object DeltetQC_FirstPieceCheck(string HInterID, string user) |
| | | { |
| | | string ModRightNameCheck = "QC_FirstPieceCheckBill_Delete"; |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 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; |
| | | } |
| | | //å¼å§äºç© |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillSub where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillSub_ValueGrid where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillSub_Result 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 = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region é¦ä»¶æ£éªåæ ¹æ®æºåç±»åè·åä¿¡æ¯-æºå为工åºè¿ç«å |
| | | [Route("QC_FirstPieceCheckBill/get_StationInBill")] |
| | | [HttpGet] |
| | | public object get_StationInBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = "select * from h_v_QC_FirstPieceCheckBill where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBill"); |
| | | string sReturn = ""; |
| | | string sql = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn)) |
| | | { |
| | | switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource) |
| | | { |
| | | case "å·¥åº": |
| | | sql = "exec h_p_QC_FirstPiece_GetStationInBillList " + "'å·¥åº','" + HInterID + "'"; |
| | | break; |
| | | case "ç©æ": |
| | | sql = "exec h_p_QC_FirstPiece_GetStationInBillList " + "'ç©æ','" + HInterID + "'"; |
| | | break; |
| | | case "å·¥èºè·¯çº¿": |
| | | sql = "exec h_p_QC_FirstPiece_GetStationInBillList " + "'å·¥èºè·¯çº¿','" + HInterID + "'"; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetStationInBillList"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | |
| | | 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; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region é¦ä»¶æ£éªåæ ¹æ®æºåç±»åè·åä¿¡æ¯-æºå为çäº§ç¶æä¸´æ¶è¡¨ï¼3722ï¼ |
| | | /// <summary> |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("QC_FirstPieceCheckBill/get_ICMOBillStatus_Tmp")] |
| | | [HttpGet] |
| | | public object get_ICMOBillStatus_Tmp(int HInterID, int HEntryID, string HBillType) |
| | | { |
| | | try |
| | | { |
| | | 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]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |