chenhaozhe
2025-07-31 9ccc52d6fce9c7dde1573cac96a82db3998195f1
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÌõÂëÉú³É/Sc_BarCodeController.cs
@@ -1501,6 +1501,106 @@
        }
        #endregion
        #region æ¡ç å­˜å…¥æ¡ç ä¸»æ¡£
        /// <summary>
        /// æ¡ç è½¬å­˜æ¡ç ä¸»æ¡£
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("Sc_BarCode/SaveBarCode_NoGenerate")]
        [HttpPost]
        public object SaveBarCode_NoGenerate([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["msg"].ToString();
                string msg1 = _value.ToString();
                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                string msg2 = sArray[0].ToString();
                string HOrgType = sArray[1].ToString();
                string HSourceBillTypeName = sArray[2].ToString();
                string HSelectBarCodeType = sArray[3].ToString();
                string CampanyName = sArray[4].ToString() == "xxx" ? "" : sArray[4].ToString();
                string UserName = sArray[5].ToString();
                string barCodeNo = sArray[6].ToString();
                ClsPub.CurUserName = UserName;
                //获取内码
                HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo);
                DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
                HOrgNumber = "";
                if (oClsGy_ORGANIZATIONS_View.GetInfoByName(HOrgType))
                {
                    HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID;
                    HOrgNumber = DBUtility.ClsPub.isStrNull(oClsGy_ORGANIZATIONS_View.omodel.HNumber);
                }
                if (HOrgID == -1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-2-055]选择组织有错误!";
                    return objJsonResult;
                }
                if (!Sub_AllowSave(msg2, HSelectBarCodeType))//单据完整性判断
                {
                    return objJsonResult;
                }
                if (HSelectBarCodeType == "仪器成品条码规则")
                {
                    //客户定制
                }
                else
                {
                    // æ¡ç è½¬å­˜
                    msg2 = msg2.Replace("\\", "");
                    msg2 = msg2.Replace("\n", "");  //\n
                    List<HSouceOrderList> ordrlist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HSouceOrderList>>(msg2);
                    LogService.Write(ordrlist[0]);
                    long HSourceInterID = string.IsNullOrEmpty(ordrlist[0].HMainID) == true ? 0 : ClsPub.isLong(ordrlist[0].HMainID);
                    long HSourceEntryID = string.IsNullOrEmpty(ordrlist[0].HSubID) == true ? 0 : ClsPub.isLong(ordrlist[0].HSubID);
                    DataSet ds1 = oCN.RunProcReturn("exec h_p_SC_BarCode_Transfer " +
                        "@HBarCodeNo = N'" + barCodeNo + "'" +
                        ",@HSubID = " + ordrlist[0].HSubID +
                        ",@HMaterID = " + ordrlist[0].HMaterID +
                        ",@HGiveAwayFlag = " + ordrlist[0].HGiveAwayFlag +
                        ",@HQty = " + ordrlist[0].HQty +
                        ",@HUnitID = " + ordrlist[0].HUnitID +
                        ",@HMinQty = " + ordrlist[0].HMinQty +
                        ",@HSupID = " + ordrlist[0].HSupID +
                        ",@HBatchNo = N'" + ordrlist[0].HBatchNo  + "'" +
                        ",@HMTONO = N'" + ordrlist[0].HMTONo + "'" +
                        ",@HBarCodeDate = N'" + ordrlist[0].HDate + "'" +
                        ",@HEmpID = " + ordrlist[0].HEmpID  +
                        ",@HGroupID = " + ordrlist[0].HGroupID +
                        ",@HSourceInterID = " + HSourceInterID +
                        ",@HSourceEntryID = " + HSourceEntryID
                        , "h_p_SC_BarCode_Transfer");
                    if((bool)ds1.Tables[0].Rows[0]["returntype"] == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "[0000-1-037]获取资源绑定数据成功!";
                    }
                    else
                    {
                        throw new Exception(ds1.Tables[0].Rows[0]["mesg"].ToString());
                    }
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "[3899-2-006]条码生成失败!" + e.Message;
                return objJsonResult;
            }
            return objJsonResult;
        }
        #endregion
        #region [条码生成接口-迦南]
        [Route("Sc_BarCode/Sub_SaveBill_JiaNan")]