1
wtt
2025-09-28 24f1233559c1f3d6f2b1a3422ea3747cd3fdaa3e
WebAPI/Controllers/LMESController.cs
@@ -647,6 +647,7 @@
                            sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere;
                        }
                    }
                    sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " ";
                    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG");
@@ -3044,7 +3045,7 @@
        //墨西哥白标生成
        [Route("LEMS/SaveCirculationCard_Json_MXG")]
        [HttpGet]
        public object SaveCirculationCard_Json_MXG(string HBillNo, string HInterID, string HBillNo2, string HBarCode,string HNumber, string HName, string HModel)
        public object SaveCirculationCard_Json_MXG(string HBillNo, string HInterID, string HBillNo2, string HBarCode,string HNumber, string HName, string HModel,string NBXMH, string HOrgID)
        {
            DataSet ds;
            try
@@ -3054,7 +3055,7 @@
                {
                    HBarCode = " ";
                }
                ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG");
                ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "','" + NBXMH + "','" + HOrgID + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG");
            }
            catch (Exception e)
@@ -3304,7 +3305,7 @@
        [Route("LEMS/SaveToSc_PackUnionBillMain_MXG")]
        [HttpGet]
        public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark, string HProjectNum, string zxQty, string BBM, string LDM, string HMaterNumber, string HBarCode_White,string HOrgID)
        public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark, string HProjectNum, string zxQty, string BBM, string LDM, string HMaterNumber, string HBarCode_White,string HOrgID,string NBXMH)
        {
            DataSet ds;
            DataSet dsHSNum;
@@ -3315,7 +3316,7 @@
                {
                    if (LDM != "其他" && BBM != "其他")
                    {
                        ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_MXG {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}'", "h_p_MES_HBarCode_White_SMR_MXG");
                        ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_MXG {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}','{NBXMH}','{HOrgID}'", "h_p_MES_HBarCode_White_SMR_MXG");
                        HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString();
                    }
                }                             
@@ -3364,6 +3365,31 @@
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub '" + HitemID + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub");
                }
            }
            catch (Exception e)
            {
                ds = null;
            }
            return CustomCorrect(ds);
        }
        [Route("LEMS/SaveToSc_PackUnionBillSub_Batch")]
        [HttpGet]
        public object SaveToSc_PackUnionBillSub_Batch(string HitemID, string HRemark)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (HitemID == null || HitemID.Equals(""))
                {
                    return CustomError("更新失败HitemID为空!");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub_Batch '" + HitemID + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub_Batch");
                }
            }
@@ -3428,6 +3454,31 @@
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Update_Flag_HRelationInterID '" + HitemID + "'", "h_p_Update_Flag_HRelationInterID");
                }
            }
            catch (Exception e)
            {
                ds = null;
            }
            return CustomCorrect(ds);
        }
        [Route("LEMS/Update_Flag_HRelationInterID_Batch")]
        [HttpGet]
        public object Update_Flag_HRelationInterID_Batch(string HitemID)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (HitemID == null || HitemID.Equals(""))
                {
                    return CustomError("更新失败HitemID为空!");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Update_Flag_HRelationInterID_Batch '" + HitemID + "'", "h_p_Update_Flag_HRelationInterID_Batch");
                }
            }
@@ -3595,7 +3646,6 @@
        #endregion
        #region 产线包装单列表查询
        [Route("LEMS/MES_ProductionLinePackagingList_Json")]
@@ -3608,11 +3658,11 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select top 1000 * from h_v_ProductionLinePackagingList order by 扫码日期 desc, 唯一条码 desc", "h_v_ProductionLinePackagingList");
                    ds = oCN.RunProcReturn("select top 300 * from h_v_ProductionLinePackagingList order by 扫码日期 desc, 唯一条码 desc", "h_v_ProductionLinePackagingList");
                }
                else
                {
                    string sql1 = "select top 1000 * from h_v_ProductionLinePackagingList where 1 = 1 ";
                    string sql1 = "select top 300 * from h_v_ProductionLinePackagingList where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    string sql2 = " order by 扫码日期 desc, 唯一条码 desc";
                    sql = sql + sql2;
@@ -3757,6 +3807,48 @@
        #endregion
        #region 获取白标项目号
        [Route("LEMS/GetHProject_MXG")]
        [HttpGet]
        public object GetHProject_MXG(string HOrgID)
        {
            DataSet ds;
            DataSet dsHSNum;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select HInterID,HSupBarCodeNumber HName from Sc_PackUnionBillBarCode_temp where HUSEORGID='" + HOrgID + "'", "Sc_PackUnionBillBarCode_temp");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取成功!";
                    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 根据ID删除缓存表中扫码记录-产线包装单
@@ -3880,7 +3972,7 @@
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "[0000-1-051]" + ds.Tables[0].Rows[0]["HBackRemark"].ToString();
                        objJsonResult.Message =ds.Tables[0].Rows[0]["HBackRemark"].ToString();
                        return objJsonResult;
                    }
                    else