llj
2025-10-20 2b5aa0f7d432d8dcd1aac3cd9d45d5a04a17d2c7
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -80,6 +80,63 @@
        }
        #endregion
        #region 返回委外工序发出单列表
        [Route("Cj_StationEntrustInBill/list_Eng")]
        [HttpGet]
        public object list_Eng(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustInBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_MES_StationEntrustInBillList_Eng", "h_v_MES_StationEntrustInBillList_Eng");
                    //  order by hmainid desc 排序丢到数据库里进行处理
                }
                else
                {
                    string sql1 = "select * from h_v_MES_StationEntrustInBillList_Eng where 1 = 1  ";
                    string sql = sql1 + sWhere + " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_MES_StationEntrustInBillList_Eng");
                }
                //添加列名
                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 = 1;
                objJsonResult.Message = "Sucess!";
                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("Cj_StationEntrustInBill/getStationEntrustInBillPage")]
        [HttpGet]
@@ -252,6 +309,10 @@
                                oCN.RunProc("exec h_p_IFCLD_ERPSourceBillToLocal_ProcExchAndRouting '" + BillNo_PGD + "'");
                                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                            }
                        }
                        else
                        {
                            ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                        }
                        break;
                }
@@ -2385,6 +2446,51 @@
        }
        #endregion
        #region 委外工序发出单流水号回车获取工序信息(序列号)
        [Route("Cj_StationEntrustInBill/txtHProcNo_KeyDown_Sec")]
        [HttpGet]
        public object txtHProcNo_KeyDown_Sec(string sBillNo, string sProcNo, string HSEQNumber)
        {
            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_Sec  where 单据号= '" + sBillNo + "' and 下道流转工序<>'转' and 委外标记=1 and 流转标记=1  and 工序号='" + sProcNo + "' and 序列号='" + HSEQNumber + "'", "h_v_Sc_ProcessExchangeBillList_Sec");
                //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;
            }
        }
        #endregion
        #region 编辑前判断
        [Route("Cj_StationEntrustInBill/set_ShowBillJudge")]
        [HttpGet]