杨乐
2022-01-12 337a4bd804496933d04a446d3ce3e9f3f9083ccc
WebAPI/Controllers/POStockInBillController.cs
@@ -268,6 +268,80 @@
                return objJsonResult;
            }
        }
        /// <summary>
        /// 写入临时表  扫源单的方法
        /// </summary>
        /// <param name="HSourceBillNo"></param>
        /// <returns></returns>
        [Route("ICMOReportBill/set_SaveICMOReportBill")]
        [HttpGet]
        public object set_SaveICMOReportBill(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo)
        {
            try
            {
                // DataSet ds = new DataSet();
                // WebServer webserver = new WebServer();
                string sWhere = " Where 单据号 like '%" + HSourceBillNo.Trim() + "'";
                //根据源单类型来调用不同的WEBS方法 new
                if (HSourceBillType == "3710")
                {
                    ds = webserver.GetSc_ICMOBillList(sWhere + "  ");
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录,源单类型有错误!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                //
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!" + HSourceBillType;
                    objJsonResult.data = null;
                    return objJsonResult;
                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
                }
                else
                {
                    HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]);
                    HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]);
                    if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, HBillType, HSourceBillNo, HSourceBillType, "蓝字", ref DBUtility.ClsPub.sErrInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "返回记录成功!";
                        objJsonResult.data = ds.Tables[0];
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "写入临时表失败!" + DBUtility.ClsPub.sErrInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 返回出入库条码临时表     
        /// </summary>
@@ -606,6 +680,66 @@
            }
        }
        /// <summary>
        /// 生产汇报单/提交/直接调webservice
        /// </summary>
        /// <returns></returns>
        [Route("ICMOReportBill/set_SaveICMOReportBill_Json")]
        [HttpPost]
        public object set_SaveICMOReportBill_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsSc_ICMOReportBillMain> lsmain = new List<Model.ClsSc_ICMOReportBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getICMOReportBillMainByJson(msg1);
                lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                string sSourceBillType = lsmain[0].HBillType;
                WebAPI.WebS.ClsSc_ICMOReportBillMain websLsmain = new WebS.ClsSc_ICMOReportBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1201";//固定值
                websLsmain.HDate = lsmain[0].HDate;
                websLsmain.HDeptID = lsmain[0].HDeptID;
                websLsmain.HEmpID = 0;
                websLsmain.HBillerID = lsmain[0].HBillerID;
                websLsmain.HRemark = "";
                websLsmain.HMainSourceBillType = lsmain[0].HBillType;
                if (webserver.set_SaveICMOReportBill_Json(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!单据号为:";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "上传失败!" + DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        [Route("POStockInBill/GetSpName_Json")]
        [HttpGet]
        public object GetSpName_Json(long HSpID, long HWHID, long HStockOrgID, ref string sErrMsg)