1
zrg
2024-06-25 4bfab3d9173fcced07cea4afb71227b83b47c469
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -318,34 +318,34 @@
                    return objJsonResult;
                }
                
                ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_QtyCtrl " + HInterID + "", "h_p_MES_StationInBill_QtyCtrl");
                if (ds == null)
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "判断数量失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows.Count == 0)
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "判断数量失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_QtyCtrl " + HInterID + "", "h_p_MES_StationInBill_QtyCtrl");
                //if (ds == null)
                //{
                //    oCN.RollBack();
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "判断数量失败!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //if (ds.Tables[0].Rows.Count == 0)
                //{
                //    oCN.RollBack();
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "判断数量失败!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
                //{
                //    oCN.RollBack();
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID + ",1");
                //判断是否是 首道工序
                ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a  " +
@@ -468,6 +468,63 @@
        }
        #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")]