|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | '@' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | string str = array[0]; | 
|---|
|  |  |  | string str = array[0]; //物料代码 | 
|---|
|  |  |  | long num = (long)ClsPub.isInt(array[4]); | 
|---|
|  |  |  | string text2 = array[6]; | 
|---|
|  |  |  | DateTime dateTime = ClsPub.isDate(array[3]); | 
|---|
|  |  |  | 
|---|
|  |  |  | bool flag3 = dataSet5.Tables[0].Rows.Count > 0; | 
|---|
|  |  |  | if (!flag3) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | POStockInBillController postockInBillController = new POStockInBillController(); | 
|---|
|  |  |  | //扫源单方法 | 
|---|
|  |  |  | postockInBillController.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo); | 
|---|
|  |  |  | //POStockInBillController postockInBillController = new POStockInBillController(); | 
|---|
|  |  |  | ////扫源单方法 | 
|---|
|  |  |  | //postockInBillController.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //WEBSController webscontroller4 = new WEBSController(); | 
|---|
|  |  |  | //object obj4 = webscontroller4.Get_SourceBarCode_PoStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID,1, oSystemParameterMain, ref DBUtility.ClsPub.sErrInfo); | 
|---|
|  |  |  | WEBSController webscontroller4 = new WEBSController(); | 
|---|
|  |  |  | object obj4 = webscontroller4.get_SourceBarCode_POStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | bool flag4 = dataSet6.Tables[0].Rows.Count > 0; | 
|---|
|  |  |  | if (!flag4) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | POStockInBillController postockInBillController2 = new POStockInBillController(); | 
|---|
|  |  |  | postockInBillController2.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo); | 
|---|
|  |  |  | //POStockInBillController postockInBillController2 = new POStockInBillController(); | 
|---|
|  |  |  | //postockInBillController2.set_SavePonderationBillMain_Temp_Source_Fast_Json("1103", text5, hinterid, HBillNo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | WEBSController webscontroller4 = new WEBSController(); | 
|---|
|  |  |  | object obj4 = webscontroller4.get_SourceBarCode_POStockIn_Json(hinterid, HBillNo, HBillType, text5, "1103", HMaker, HOrgID); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | bool flag6 = text7.Contains("W") || text7.Contains("N"); | 
|---|
|  |  |  | if (flag6) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | string text8 = sBarCodeNew.Substring(0, 10);//商品码 | 
|---|
|  |  |  | string text8 = sBarCodeNew.Substring(0, 10);//商品码    商品码+物料代码+生产日期+批次+失效日期+一位字母+三位数字 | 
|---|
|  |  |  | string str4 = sBarCodeNew.Substring(10, 10);//物料代码 | 
|---|
|  |  |  | string text9 = "20" + sBarCodeNew.Substring(20, 6); | 
|---|
|  |  |  | long num8 = (long)ClsPub.isInt(text9.Substring(0, 4)); | 
|---|
|  |  |  | long num9 = (long)ClsPub.isInt(text9.Substring(4, 2)); | 
|---|
|  |  |  | long num10 = (long)ClsPub.isInt(text9.Substring(6, 2)); | 
|---|
|  |  |  | long num8 = (long)ClsPub.isInt(text9.Substring(0, 4));  //年 | 
|---|
|  |  |  | long num9 = (long)ClsPub.isInt(text9.Substring(4, 2));  //月 | 
|---|
|  |  |  | long num10 = (long)ClsPub.isInt(text9.Substring(6, 2)); //日 | 
|---|
|  |  |  | long num11 = (long)ClsPub.isInt(sBarCodeNew.Remove(0, sBarCodeNew.Length - 3));//后三位永远都是数字 | 
|---|
|  |  |  | string text10 = sBarCodeNew.Remove(0, sBarCodeNew.Length - 10);//失效日期+一位字母+三位数字 | 
|---|
|  |  |  | string text11 = "20" + text10.Substring(0, 6); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /*前十位物料代码,后六位生效日期,倒数前三位是数字前六位是失效日期  批号改为动态获取*/ | 
|---|
|  |  |  | /*前十位物料代码,后六位生效日期,倒数前三位是数字前六位是失效日期 */ | 
|---|
|  |  |  | string str6 = sBarCodeNew.Substring(0, 10);//物料代码 | 
|---|
|  |  |  | string text17 = "20" + sBarCodeNew.Substring(10, 6); | 
|---|
|  |  |  | long num21 = (long)ClsPub.isInt(text17.Substring(0, 4)); | 
|---|
|  |  |  | 
|---|
|  |  |  | "-", | 
|---|
|  |  |  | num27.ToString() | 
|---|
|  |  |  | })); | 
|---|
|  |  |  | string text20 = sBarCodeNew.Remove(0, 16); | 
|---|
|  |  |  | string text21 = text20.Remove(text20.Length - 9, 9); | 
|---|
|  |  |  | ClsCN clsCN3 = new ClsCN(); | 
|---|
|  |  |  | string text20 = sBarCodeNew.Remove(0, 16); //SAE1300100 230309 2303704 250308 010 | 
|---|
|  |  |  | string text21 = text20.Remove(text20.Length - 9 , 9); //SAE1300100230309 2303704 250308010 | 
|---|
|  |  |  | ClsCN clsCN3 = new ClsCN(); | 
|---|
|  |  |  | DataSet dataSet13 = clsCN3.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str6 + "' and  huseorgid = " + HOrgID.ToString(), "Gy_Material"); | 
|---|
|  |  |  | long num28 = ClsPub.isLong(dataSet13.Tables[0].Rows[0]["HItemID"]); | 
|---|
|  |  |  | string text22 = ClsPub.isStrNull(dataSet13.Tables[0].Rows[0]["HName"]); | 
|---|
|  |  |  | 
|---|
|  |  |  | "-", | 
|---|
|  |  |  | num23.ToString() | 
|---|
|  |  |  | })); | 
|---|
|  |  |  | DataSet dataSet16 = clsCN3.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); | 
|---|
|  |  |  | DataSet dataSet16 = clsCN3.RunProcReturn(" select * from Gy_BarCodeBill where HBarCode= '" + text1 + "'", "Gy_BarCodeBill"); | 
|---|
|  |  |  | bool flag10 = dataSet16.Tables[0].Rows.Count > 0; | 
|---|
|  |  |  | if (flag10) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //可能和他们的登录组织有关系 | 
|---|
|  |  |  | string billCode3 = "85"; | 
|---|
|  |  |  | long num32 = ClsPub.CreateBillID_Prod(billCode3, ref ClsPub.sExeReturnInfo); | 
|---|
|  |  |  | long num33 = 0L; | 
|---|
|  |  |  | 
|---|
|  |  |  | List<Model.ClsKf_POStockInBillMain> lsmain = new List<Model.ClsKf_POStockInBillMain>(); | 
|---|
|  |  |  | ListModels oListModels = new ListModels(); | 
|---|
|  |  |  | lsmain = oListModels.getPOStockInBillMainByJson(msg1); | 
|---|
|  |  |  | lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); | 
|---|
|  |  |  | lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); | 
|---|
|  |  |  | //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.ClsKf_POStockInBillMain websLsmain = new WebS.ClsKf_POStockInBillMain(); | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "成功!单据号为:"; | 
|---|
|  |  |  | objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功! | 
|---|
|  |  |  | //objJsonResult.Message = "成功!单据号为:"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "上传失败!" + DBUtility.ClsPub.sErrInfo; | 
|---|
|  |  |  | objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败! | 
|---|
|  |  |  | //objJsonResult.Message = "上传失败!" + DBUtility.ClsPub.sErrInfo; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DataSet dataSet = this.oCn.RunProcReturn("exec h_p_ReceiveBill_Fast " + hinterID, "h_p_ReceiveBill_Fast"); | 
|---|
|  |  |  | DataRow dataRow = dataSet.Tables[0].Rows[0]; | 
|---|
|  |  |  | if (dataSet.Tables[0].Rows.Count == 1 && dataSet.Tables[0].Rows[0]["FRECEIVENumber"].ToString() == "0") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | this.objJsonResult.code = "0"; | 
|---|
|  |  |  | this.objJsonResult.count = 0; | 
|---|
|  |  |  | this.objJsonResult.Message = "存在多个采购订单单据类型,不允许提交!"; | 
|---|
|  |  |  | this.objJsonResult.data = null; | 
|---|
|  |  |  | return this.objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | bool flag4 = dataSet.Tables[0].Rows.Count <= 0; | 
|---|
|  |  |  | bool flag5 = flag4; | 
|---|
|  |  |  | bool flag6 = flag5; | 
|---|
|  |  |  | 
|---|
|  |  |  | jobject16.Add("FSRCENTRYID", dataRow2["FENTRYID"].ToString()); | 
|---|
|  |  |  | jobject16.Add("FORDERBILLNO", dataRow2["FBILLNO"].ToString()); | 
|---|
|  |  |  | jobject16.Add("FPOORDERENTRYID", dataRow2["FENTRYID"].ToString()); | 
|---|
|  |  |  | jobject16.Add("FGiveAway", dataRow2["FGIVEAWAY"].ToString());//是否赠品 | 
|---|
|  |  |  | //jobject16.Add("FPrice", dataRow2["FPRICE"].ToString()); | 
|---|
|  |  |  | //jobject16.Add("FTaxPrice", dataRow2["FTAXPRICE"].ToString()); | 
|---|
|  |  |  | //jobject16.Add("FEntryTaxRate", dataRow2["FTAXRATE"].ToString()); | 
|---|
|  |  |  | 
|---|
|  |  |  | ,D.FSUPPLIERID,DS.FNUMBER AS FSUPPLIERNUMBER,D.FPURCHASEORGID,DOO.FNUMBER AS FPURCHASEORGNUMBER,CROO.FNUMBER  AS FSETTLEORGNUMBER, | 
|---|
|  |  |  | E.FPRICETIMEPOINT,E.FSETTLECURRID,EC.FNUMBER AS FSETTLECURRNUMBER,C.FMATERIALID,CM.FNUMBER AS FMATERIALNUMBER ,C.FUNITID | 
|---|
|  |  |  | ,CU.FNUMBER AS FUNITNUMBER,CR.FPRICE,CR.FTAXPRICE,CR.FTAXRATE,D.FPURCHASERID,isnull(T4.FNUMBER,'') AS FPURCHASERNUMBER | 
|---|
|  |  |  | ,C.FGIVEAWAY AS FGIVEAWAY | 
|---|
|  |  |  | FROM CG_POINSTOCKBILLSUB B | 
|---|
|  |  |  | JOIN CG_POINSTOCKBILLMAIN M ON B.HINTERID = M.HINTERID | 
|---|
|  |  |  | JOIN {0}..T_PUR_POORDERENTRY C ON B.HSOURCEINTERID = C.FID AND B.HSOURCEENTRYID = C.FENTRYID | 
|---|
|  |  |  | 
|---|
|  |  |  | FentityModel.Add("FPrice", item["FPRICE"].ToString());//单价 | 
|---|
|  |  |  | FentityModel.Add("FTaxPrice", item["FTAXPRICE"].ToString());//含税单价 | 
|---|
|  |  |  | FentityModel.Add("FEntryTaxRate", item["FTAXRATE"].ToString());//税率 | 
|---|
|  |  |  | FentityModel.Add("FGiveAway", item["FGIVEAWAY"].ToString());//是否赠品 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | JArray Fentity2 = new JArray(); | 
|---|
|  |  |  | JObject FentityModel2 = new JObject(); | 
|---|