1
沈泽
2021-08-27 d3b2b4ed9036646d58dc1e998e2a30c9383db6ed
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -33,11 +33,11 @@
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_MES_StationEntrustInBillList " + sWhere, "h_v_MES_StationEntrustInBillList");
                    ds = oCN.RunProcReturn("select * from h_v_MES_StationEntrustInBillList " + sWhere+ " order by 发出时间 desc", "h_v_MES_StationEntrustInBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_MES_StationEntrustInBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_MES_StationEntrustInBillList where 1 = 1  order by 发出时间 desc";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_MES_StationEntrustInBillList");
                }
@@ -408,6 +408,55 @@
        }
        /// <summary>
        /// 委外工序发出单流水号回车获取工序信息
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Cj_StationEntrustInBill/txtHProcNo_KeyDown")]
        [HttpGet]
        public object txtHProcNo_KeyDown(string sBillNo, string sProcNo)
        {
            try
            {
                if (sBillNo.Equals("") || sProcNo.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "条形码不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //得到信息(委外标记为0时,流转标记为1时)
                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + sBillNo + "' and 下道流转工序<>'转' and 委外标记=1 and 流转标记=1  and 工序号='" + sProcNo + "'", "h_v_Sc_ProcessExchangeBillList");
                //Ds = oCn.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + sBillNo + "' and 工序号='" + sProcNo + "' and 委外标记=0 and 流转标记=1 ", "h_v_Sc_ProcessExchangeBillList");
                //写入信息
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "工序号错误或者当前工序号不允许进站,请重新输入!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                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;
            }
        }
        //