| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序进站接收单流水号回车 系统参数判断是否绑定配件清单 |
| | | [Route("Cj_StationInBill/MES_StationInBillSubBindSource")] |
| | | [HttpGet] |
| | | public object MES_StationInBillSubBindSource(string HInterID, string HProcExchInterID,string HProcExchEntryID) |
| | | { |
| | | try |
| | | { |
| | | //如果系统参数启用了 进站单绑定配件清单则 从生产用料清单中获取工序BOM写入 临时表,并加载表格 |
| | | Pub_Class.ClsXt_SystemParameter oParam = new ClsXt_SystemParameter(); |
| | | string sIsBingLine = oParam.GetSingleSystemParameter("MES_StationInBill_LineBindCtl", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (sIsBingLine.Trim() == "Y") |
| | | { |
| | | oCN.RunProc("exec h_p_MES_StationInBillSubBindSource_Insert " + HProcExchInterID.ToString() + " , " + HProcExchEntryID.ToString() + "," + HInterID.ToString() + " "); |
| | | |
| | | ds = oCN.RunProcReturn($@"select * from |
| | | ( |
| | | select |
| | | a.HICMOInterID,a.HICMOEntryID,b.HProcID |
| | | from Sc_ProcessExchangeBillMain a with(nolock) |
| | | inner join Sc_ProcessExchangeBillSub b with(nolock) on a.HInterID=b.HinterID |
| | | Where a.HInterID={HProcExchInterID} and b.HEntryID={HProcExchEntryID} |
| | | ) a |
| | | inner join ( |
| | | select a.HICMOInterID,a.HICMOEntryID, b.HProcID |
| | | from Sc_PPBomBillMain a with(nolock) |
| | | inner join Sc_PPBomBillSub b with(nolock) on a.HInterID=b.HInterID |
| | | Where b.HKeyMaterID_Line<>0 |
| | | )b on a.HICMOInterID=b.HICMOInterID and a.HICMOEntryID=b.HICMOEntryID and a.HProcID=b.HProcID", "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) { |
| | | objJsonResult.Message = "需要绑定配件!"; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.Message = "不需要绑定配件!"; |
| | | } |
| | | } |
| | | else { |
| | | objJsonResult.Message = "不需要绑定配件!"; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.data =null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 工序进站接收单流水号回车获取工序信息 |
| | | [Route("Cj_StationInBill/txtHProcNo_KeyDown_qiaoyi")] |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | //删除前控制========================================= |
| | | string HBillNo = oBill.omodel.HBillNo; |
| | | string sql1 = "exec h_p_Sc_StationInBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + HDeleteMan + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, HBillNo, "h_p_Sc_StationInBill_AfterDelCtrl", HDeleteMan, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |