yxj
2022-11-01 4992ccc68d7a0d71165e71f814b8352fae9c3948
WebAPI/Controllers/POStockInBillController.cs
@@ -411,6 +411,55 @@
        }
        [Route("Kf_QCStockInCheckBill_Fast/BarCode_Json")]
        [HttpGet]
        public object BarCode_Json(string HBarCode)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select * from h_v_QCStockInCheckBill_Json where  条码编号 ='" + HBarCode.ToString() + "'" , "h_v_QCStockInCheckBill_Json");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
                }
                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;
            }
        }
        /// <summary>
        /// 返回出入库条码临时表     
        /// </summary>
@@ -1475,6 +1524,19 @@
                var hinterID = list[0].HInterID;
                var FID = list[0].FID;
                #region 校验是否扫描条码
                var HInterID = list[0].HInterID;
                string jysql = string.Format(@"select * from KF_PonderationBillMain_Temp where HSourceInterID = {0}", HInterID);
                DataTable jyDt =oCn.RunProcReturn(jysql, "jysql").Tables[0];
                if (jyDt.Rows.Count == 0 || jyDt == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请扫描条码";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                #endregion
                #region 金蝶审核后会重新同步单据到mes 故不需要更新mes的收料通知单 
                /*
                oCn.BeginTran();
@@ -1496,7 +1558,7 @@
                //更新成功后 同步更新金蝶
                oCn.Commit();
                **/
                #endregion
                #endregion
                JObject jsonRoot = new JObject();
                jsonRoot.Add("Creator", "");
@@ -1605,7 +1667,7 @@
            {
                //var code = HBarcode.Split('#')[0];
                //校验条码是否存在
                string sql = $"select* from  Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}";
                string sql = $"select HItemID,HSourceBillNo from  Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}";
                DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList");
                if (ds.Tables[0].Rows.Count == 0)
                {
@@ -1615,6 +1677,29 @@
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                else
                {
                    //存入条码临时表
                    sql = $"delete from KF_PonderationBillMain_Temp Where HBillNo='{ds.Tables[0].Rows[0]["HSourceBillNo"]}' ";
                    oCn.RunProc(sql);
                    sql = string.Format(@"Insert into KF_PonderationBillMain_Temp
   (HInterID,HBillNo,HBillType,HMaterID,HProcID,HWhID,HSCWHID
   ,HStockPlaceID,HOutStockPlaceID,HGroupID,HQty,HQtyMust,HPieceQty
   ,HAuxPropID,HBatchNo,HBarCode,HAddr,HMaker,HMakeDate
   ,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HMTONo
   ,HSTOCKORGID,HOWNERID,HExpressNumber,HSubBillType
   ,HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag
   ,HCusID)
   select HInterID,HSourceBillNo,HBillType,HMaterID,0,0,0
   ,0,0,0,HQty,HQty,0
   ,HAuxPropID,HBatchNo,'','','System',getdate()
   ,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HMTONo
   ,HSTOCKORGID,HOWNERID,'',HBillType
   ,0,0,'',0
   ,0 from Gy_BarCodeBill
   where HItemID = {0}", ds.Tables[0].Rows[0]["HItemID"]);
                    oCn.RunProc(sql);
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;