yangle
2024-11-12 722b6aa81bfcc1801e0868e0c94931644659d5a1
墨西哥白标报表
墨西哥白标生成
1个文件已修改
212 ■■■■■ 已修改文件
WebAPI/Controllers/LMESController.cs 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/LMESController.cs
@@ -669,6 +669,51 @@
            //return ds.Tables[0].Rows;
        }
        //墨西哥白标查询
        [Route("MES/MES_BarcodeWhiteLabelReport")]
        [HttpGet]
        public object MES_BarcodeWhiteLabelReport(string sWhere)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("SELECT top 1000 * FROM  h_v_MES_BarcodeWhiteLabelReport where 1=1 " + sWhere, "h_v_MES_BarcodeWhiteLabelReport");
            }
            catch (Exception e)
            {
                ds = null;
            }
            return CustomCorrect(ds);
            //return ds.Tables[0].Rows;
        }
        //墨西哥白标生成
        [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)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (HBarCode == null || HBarCode.Equals(""))
                {
                    HBarCode = " ";
                }
                ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG");
            }
            catch (Exception e)
            {
                ds = null;
            }
            return CustomCorrect(ds);
            //return ds.Tables[0].Rows;
        }
        /// <summary>
        /// 扫子件条码方法(产线包装单、产线组装追溯单)--根据子件条码保存到temp表
        ///参数:string sql。
@@ -701,6 +746,37 @@
                    }
                    ds = oCN.RunProcReturn("exec h_p_Save_SubBarcodeToTmp '" + HBillNo + "','" + SubBarcode + "','" + HInterID + "','" + HBillNo2 + "','" + HBillType + "','" + sMaker + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "'", "h_p_Save_SubBarcodeToTmp");
                }
            }
            catch (Exception e)
            {
                ds = null;
            }
            return CustomCorrect(ds);
            //return ds.Tables[0].Rows;
        }
        [Route("LEMS/SaveSubBarcode_Json_MXG")]
        [HttpGet]
        public object SaveSubBarcode_Json_MXG(string HBillNo, string SubBarcode, string HInterID, string HBillNo2,
          string HBillType, string sMaker, string HBarCode, string HNumber, string HName, string HModel)
        {
            DataSet ds1;
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds1 = oCN.RunProcReturn("select * from KF_PonderationBillMain_Temp where HSourceBillNo = '" + SubBarcode + "' and HBillType = '" + HBillType + "'", "KF_PonderationBillMain_Temp");
                if (ds1.Tables[0].Rows.Count > 0)
                {
                    return CustomError("该子件条码已存在");
                }
                if (HBarCode == null || HBarCode.Equals(""))
                {
                    HBarCode = " ";
                }
                ds = oCN.RunProcReturn("exec h_p_Save_SubBarcodeToTmp '" + HBillNo + "','" + SubBarcode + "','" + HInterID + "','" + HBillNo2 + "','" + HBillType + "','" + sMaker + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "'", "h_p_Save_SubBarcodeToTmp");
            }
            catch (Exception e)
@@ -821,7 +897,7 @@
                string HBarCode_White = "";
                if (LDM != "其他" && BBM != "其他" )
                {
                    ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR {zxQty},'{BBM}','{HMaterNumber}'", "h_p_MES_HBarCode_White_SMR");
                    ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}'", "h_p_MES_HBarCode_White_SMR");
                    HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString();
                }
@@ -851,6 +927,51 @@
            return CustomCorrect(ds);
            //return ds.Tables[0].Rows;
        }
        [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)
        {
            DataSet ds;
            DataSet dsHSNum;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //HBarCode_White = "";
                //if (LDM != "其他" && BBM != "其他")
                //{
                //    ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}'", "h_p_MES_HBarCode_White_SMR");
                //    HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString();
                //}
                //项目号获取流水号
                dsHSNum = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HProjectNum + "'", "h_p_WMS_GetMaxNo");
                oCN.RunProc("exec h_p_WMS_SetMaxNo '" + HProjectNum + "'");
                int HSNum = ClsPub.isInt(dsHSNum.Tables[0].Rows[0][0]) + 1;
                //调用进制转换方法把流水号转换成流水号2
                string HSNum2 = GetNewCodeByNum(HSNum, 1, 2);
                if (HBillNo == null || HBillNo.Equals(""))
                {
                    return CustomError("流转卡号不能为空!");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain_MXG '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "','" + HBarCode_White + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain_MXG");
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
            return CustomCorrect(ds);
            //return ds.Tables[0].Rows;
        }
        /// <summary>
        /// 提交-子表方法(产线包装单)--根据子件条码从temp表保存到子表
@@ -1062,7 +1183,7 @@
                        + HEndDate + "','" + HWorkLineName + "','" + HBarCodeDate + "','" + HSTOCKORGID + "'," + HOWNERID + ",'"
                        + HSeOrderBillNo + "','" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "','" + HAuxPropID + "','" + HMTONo + "')"
                );
                ds = oCn.RunProcReturn("select HBarCode from Gy_BarCodeBill where HSourceBillNo = '" + sHBarcodeNo + "'  order by HMakeDate desc", "Gy_BarCodeBill");
                ds = oCn.RunProcReturn("select top 10 HBarCode from Gy_BarCodeBill where HSourceBillNo = '" + sHBarcodeNo + "'  order by HMakeDate desc", "Gy_BarCodeBill");
            }
            catch (Exception e)
            {
@@ -1313,21 +1434,21 @@
        //判断条码之前的工序是否出站
        [Route("LEMS/SNBarcodeProcCtrl")]
        [HttpGet]
        public object SNBarcodeProcCtrl(string SubBarcode,string HProcExchBillNo)
        public object SNBarcodeProcCtrl(string SubBarcode,string HProcExchBillNo,string HMixedBox, string HBillNo)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn(" select  * from Gy_BarCodeBill where HSourceBillNo='" + HProcExchBillNo + "' and HBarCode='" + SubBarcode + "'", "Gy_BarCodeBill");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查无数据,条码:" + SubBarcode + "不属于当前流转卡:" + HProcExchBillNo + "!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //ds = oCN.RunProcReturn(" select  * from Gy_BarCodeBill where HSourceBillNo='" + HProcExchBillNo + "' and HBarCode='" + SubBarcode + "'", "Gy_BarCodeBill");
                //if (ds.Tables[0].Rows.Count == 0)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "查无数据,条码:" + SubBarcode + "不属于当前流转卡:" + HProcExchBillNo + "!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                ds = oCN.RunProcReturn(@"exec h_p_Sc_SNBarcodeProcCtrl '" + SubBarcode + "'", "h_p_Sc_SNBarcodeProcCtrl");
                if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
@@ -1348,6 +1469,72 @@
                }
                else
                {
                    ds = oCN.RunProcReturn(@"exec h_p_Sc_SNBarcodeMixedBox '" + SubBarcode + "','" + HProcExchBillNo + "','"+ HMixedBox + "','"+ HBillNo + "'", "h_p_Sc_SNBarcodeMixedBox");
                    if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "查无数据!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString();
                        return objJsonResult;
                    }
                    else {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = null;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "异常!";
                objJsonResult.data = e.ToString();
                return objJsonResult;
            }
        }
        //09项目判断配件条码 模具穴号是否匹配
        [Route("LEMS/h_p_CJ_SNBarCodeBillMouldBathSelect")]
        [HttpGet]
        public object h_p_CJ_SNBarCodeBillMouldBathSelect(string SubBarcode, string HProcExchBillNo, string HBillType)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn(@"exec h_p_CJ_SNBarCodeBillMouldBathSelect '" + SubBarcode + "','" + HProcExchBillNo + "','" + HBillType + "'", "h_p_Sc_SNBarcodeMixedBox");
                if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查无数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString();
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = null;
@@ -1364,7 +1551,6 @@
                return objJsonResult;
            }
        }
        //判断总的包装数量是否超过流转卡数量
        [Route("LEMS/h_p_Sc_ProductionLinePackaging_Checkqty")]