yusijie
2025-06-03 01685f3ab68f64b51b83eee40af90f4030866691
WebAPI/Controllers/LMESController.cs
@@ -192,7 +192,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select top 1000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 单据号 desc ", "h_v_Sc_ProcessExchangeBillList_Query");
                ds = oCN.RunProcReturn("select top 3000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 单据号 desc ", "h_v_Sc_ProcessExchangeBillList_Query");
                //添加列名
@@ -285,6 +285,98 @@
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_ProcessExchangeBillList_Query " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Sc_ProcessExchangeBillList_Query");
                }
                //添加列名
                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 = "异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 工序流转卡维护-查询-分页
        /// <summary>
        /// 返回工序流转卡维护列表主表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("LEMS/Sc_ProcessExchangeBillList_QueryCheckRecord_byPage")]
        [HttpGet]
        public object Sc_ProcessExchangeBillList_QueryCheckRecord_byPage(string sWhere, string user, string Organization, int page, int size, string HBillSubType)
        {
            DataSet ds;
            try
            {
                List<object> columnNameList = new List<object>();
                if (HBillSubType == "SUB")
                {
                    //判断是否有查询权限
                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "指引卡无查询权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    //判断是否有查询权限
                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "流转卡无查询权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                //获取系统参数
                string Ret = "";
                if (oSystemParameter.ShowBill(ref Ret))
                {
                    //判断客户为龙山汽配
                    if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配")
                    {
                        //获取需要拼接的字符串
                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "工序派工单列表");
                        sWhere += sql_splice;
                    }
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_ProcessExchangeBillCheckRecordListPage " + page + "," + size + "," + "''", "h_p_Sc_ProcessExchangeBillList_Query");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_ProcessExchangeBillCheckRecordListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_ProcessExchangeBillList_Query");
                }
                //添加列名
@@ -951,6 +1043,35 @@
                string sql = "select * from h_v_Sc_ProcessExchangeBillQuerySub where hmainid = ";
                string sql1 = sql + sWhere;
                ds = oCN.RunProcReturn(sql1 + " order by cast(工序号 as int)", "h_v_Sc_ProcessExchangeBillQuerySub");
                return GetObjectJson(ds);
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "[0000-1-045]没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 返回工序流转卡维护列表从表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("LEMS/MES_Sc_ProcessExchangeBillQueryCheckRecordSub_Json")]
        [HttpGet]
        public object MES_Sc_ProcessExchangeBillQueryCheckRecordSub_Json(string sWhere, int selected)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = "exec h_p_ProcessExchangeBillCheckRecordList_GetSubBillList " +
                    "@sWhere = N'" + sWhere + "'" +
                    ", @selected = N'" + selected + "'";
                ds = oCN.RunProcReturn(sql, "h_p_ProcessExchangeBillCheckRecordList_GetSubBillList");
                return GetObjectJson(ds);
            }
            catch (Exception e)
@@ -3601,7 +3722,7 @@
                }
                //刷新默认工艺路线
                oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID+",'" + user + "'");
                oCN.RunProc("exec h_p_Gy_RoutingBillSetDefault " + HInterID+",'" + user + "'");
                oCN.Commit();//提交事务
@@ -3705,10 +3826,10 @@
                            return objJsonResult;
                        }
                    }
                    string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //审核前控制=========================================      
                    string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                    string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
@@ -3736,7 +3857,7 @@
                    //审核后控制=========================================      
                    string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                    string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_AfterCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {