llj
2025-10-31 b8d7145eadce706aef50ef95be75cff9ef79b518
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÌõÂëÉú³É/Sc_BarCodeController.cs
@@ -25,6 +25,7 @@
        public WebServer webserver = new WebServer();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        private WebS.WebService1 oWebs = new WebS.WebService1();
        public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        public Int64 HInterID = 0;      //内码
@@ -909,6 +910,8 @@
            string HSupNumber = ""; // ä¾›åº”商编码
            string HPOInStockBillNo = ""; // æ”¶æ–™é€šçŸ¥å•号
            string HPOOrderBillNo = ""; // é‡‡è´­è®¢å•号
            DataSet Ds;
            msg2 = msg2.Replace("\\", "");
            msg2 = msg2.Replace("\n", "");  //\n
@@ -959,6 +962,8 @@
                    
                    HPOInStockBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo); // æ”¶æ–™é€šçŸ¥å•号 å…´è¾¾æ¡ç 
                    HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);// ä¾›åº”商编号 å…´è¾¾æ¡ç 
                    HPOOrderBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo); // é‡‡è´­è®¢å•号 å°å«ç”µå™¨
                    //
                    sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
                    sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
@@ -1069,6 +1074,14 @@
                            Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                            LSHlen = 3; // ä¸‰ä½æµæ°´å·
                        }
                        else if (CampanyName.Contains("小卫"))
                        {
                            // å°å«ç”µå™¨
                            // æ¡ç å‰ç¼€ = å•据号 + ç‰©æ–™ç¼–码 + æ‰¹æ¬¡å·
                            sTMNumber = HPOOrderBillNo + "@" + HMaterNumber + "@" + HBatchNo;
                            Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        }
                        else  //通用方法
                        {
@@ -1892,12 +1905,12 @@
        #region [获取标签打印指令 CPCL指令]
        [Route("Sc_BarCode/Get_BarCodePrintCode_CPCL")]
        [HttpGet]
        public object Get_BarCodePrintCode_CPCL(string HOrginationName, string HViewName, string HBillSubType, int HInterID, int HItemID)
        public object Get_BarCodePrintCode_CPCL(string HOrginationName, string HBillSubType, int HInterID, int HItemID)
        {
            try
            {
                ds = oCN.RunProcReturn("exec h_p_getHBarCodePrintCode_CPCL N'" + HOrginationName + "'" +
                   ",N'" + HViewName + "',N'" + HBillSubType + "'," + HInterID + "," + HItemID, "h_p_getHBarCodePrintCode_CPCL");
                   ",N'" + HBillSubType + "'," + HInterID + "," + HItemID, "h_p_getHBarCodePrintCode_CPCL");
                if((int)ds.Tables[0].Rows[0]["resultType"] == 1)
                {
                    string resultMesg = ds.Tables[0].Rows[0]["payload"].ToString().Replace("\\r\\n", "\r\n");
@@ -2738,30 +2751,51 @@
        #endregion
        #region [条码生成接口_小卫镭雕码]
        [Route("Sc_BarCode/GetSNByICMO_XW")]
        [Route("Sc_BarCode/SaveSNByICMO_XW")]
        [HttpGet]
        public object GetSNByICMO(String HBillNo,int HSeq)
        public object SaveSNByICMO_XW(String HBillNo,string HSN, int HBeginNo, int HEndNo, int HCount,string HMachineCode)
        {
            try
            {
                ds = oCN.RunProcReturn("exec h_p_WMS_GetSNByICMO_XW '" + HBillNo + "', "+ HSeq, "h_p_WMS_GetSNByICMO_XW");
                if (ds.Tables[0].Rows.Count > 0)
                if(oWebs.GetWebAPIToLocal_ICMO(HBillNo, "3710", "admin", ref DBUtility.ClsPub.sErrInfo)==false)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "[0000-1-037]条码生成成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-2-020]单据同步失败请联系管理员,"+ DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-2-020]没有返回任何结果,条码生成失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    ds = oCN.RunProcReturn("exec h_p_WMS_SaveSNByICMO_XW '" + @HBillNo + "', " + HSN +","+HBeginNo+","+HEndNo+","+HCount+",'"+HMachineCode+"'", "h_p_WMS_SaveSNByICMO_XW");
                    if (ds == null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "[0000-2-020]没有返回任何结果,条码保存失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "[0000-2-020]条码绑定失败!"+ ds.Tables[0].Rows[0]["HRemark"].ToString();
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "[0000-1-037]条码生成成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {