ch
2022-11-15 be324e1dc4df9e72b0b8986d596b723404804f22
WebAPI/Controllers/POStockInBillController.cs
@@ -90,6 +90,7 @@
                WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
                string sExpressNumber = "";
                WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
                //WebSoBar = oWebs.get_ba(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
@@ -169,6 +170,76 @@
        }
        [Route("kf_PoStockInBill/JX_Json")]
        [HttpGet]
        public Object JX_Json(string sBarCodeNew,Int64 HOrgID)
        {
            try
            {
                string[] sArray = sBarCodeNew.Split('@');
                string HMaterNumber = "";
                HMaterNumber = sArray[0];
                Int64 HQty = 0;
                HQty = ClsPub.isInt(sArray[4]);
                string HBarchNo = "";
                HBarchNo = sArray[6];
                Int64 HMaterID = 0;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                DataSet Dss;
                Dss = oCn.RunProcReturn(" select HNumber from h_v_CLD_ORGANIZATIONSList where HItemID= " + HOrgID, "h_v_CLD_ORGANIZATIONSList");
                string  HOrgNumber = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HNumber"]);
                DataSet Dss1;
                Dss1 = oCn.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + HMaterNumber + "' and  huseorgid = " + HOrgID, "Gy_Material");
                HMaterID = Pub_Class.ClsPub.isLong(Dss1.Tables[0].Rows[0]["HItemID"]);
                string HMaterName = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HName"]);
                string HMaterModel = Pub_Class.ClsPub.isStrNull(Dss1.Tables[0].Rows[0]["HModel"]);
                Int64 HUnitID = Pub_Class.ClsPub.isInt(Dss1.Tables[0].Rows[0]["HUnitID"]);
                string HTM = "";
                HTM = HOrgNumber + HMaterID + HBarchNo;
                string ModName = "85";
                HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                   ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                   ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                   ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                   ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                   ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
                                   ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " +
                                   ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                   ") values ("
                                   + "'" + HTM + "','批次条码'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString()
                                   + ",'" + HBarchNo + "'," + HSupID.ToString() + ",0,'" + ClsPub.CurUserName + "',getdate(),0," + HQty.ToString()
                                   + ", 0,0,'','',0"
                                   + ", 0,'',0,0,0,''"
                                   + ",0,'','','',getdate()"
                                   + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",''," + HInterID.ToString() + ",1"
                                   + ",0,0,0"
                                   + ",'" + HMaterName + "','" + HMaterModel + "','',0,'','')");
                string sExpressNumber = "";
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                objJsonResult.data = HTM;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = e.Message + ";" + e.StackTrace;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 一键扫码红字