| | |
| | | { |
| | | try |
| | | { |
| | | string _msg = msg["msg"].ToString(); |
| | | string HMaker =""; //å¶å人 |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string _msg = sArray[0].ToString(); |
| | | if(sArray.Length>1) |
| | | { |
| | | HMaker = sArray[1].ToString(); |
| | | } |
| | | |
| | | _msg = _msg.Replace("\\", ""); |
| | | _msg = _msg.Replace("\n", ""); |
| | | List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg); |
| | |
| | | ["IsVerifyBaseDataField"] = "false", |
| | | ["Model"] = model |
| | | }; |
| | | var loginRet = InvokeHelper.Login(); |
| | | //ç»å½ |
| | | var loginRet = InvokeHelper.LoginUser(HMaker); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | if (isSuccess == 0) |
| | | { |
| | |
| | | LogService.Write("æ¶æéç¥åå®¡æ ¸æ æ°æ®ï¼" + sql); |
| | | } |
| | | } |
| | | else //å¤å® ï¼æ´æ°erpä¿¡æ¯ |
| | | else if(FCusName.Contains("å¤å®")) |
| | | { |
| | | JObject jsonRoot = new JObject(); |
| | | jsonRoot.Add("Creator", ""); |
| | | jsonRoot.Add("NeedUpDateFields", new JArray()); |
| | | jsonRoot.Add("NeedReturnFields", new JArray()); |
| | | jsonRoot.Add("IsDeleteEntry", "True"); //注æIsDeleteEntryåæ°ï¼å¦ä¸ºTrueï¼åååå½è¡çFEntryIdæªå¨åå½jsonåºç°çè¡ï¼å°ä¼è¢«å é¤ ï¼å¦æ éå é¤åå½è¡ï¼å¯æ¹ä¸ºfasleï¼ |
| | | jsonRoot.Add("SubSystemId", ""); |
| | | jsonRoot.Add("IsVerifyBaseDataField", ""); |
| | | |
| | | JObject jsonModel = new JObject(); |
| | | jsonModel.Add("FID", FID); |
| | | JArray Entry = new JArray(); |
| | | foreach (var item in list) |
| | | { |
| | | if (item.HSQty == 0) |
| | | continue; |
| | | JObject jsonFPOOrderEntry = new JObject(); |
| | | jsonFPOOrderEntry.Add("FEntryID", item.FEntryID); |
| | | jsonFPOOrderEntry.Add("FActReceiveQty ", item.HSQty); ; |
| | | Entry.Add(jsonFPOOrderEntry); |
| | | } |
| | | jsonModel.Add("FDetailEntity", Entry); |
| | | jsonRoot.Add("Model", jsonModel); |
| | | //ç»å½ |
| | | var loginRet = InvokeHelper.LoginUser(HMaker); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | if (isSuccess <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = loginRet; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | var result = InvokeHelper.Save("PUR_ReceiveBill", jsonRoot.ToString()); |
| | | //LogService.Write(result); |
| | | if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | LogService.Write("æ¶æéç¥åä¿®æ¹å¤±è´¥jsonRoot:" + jsonRoot.ToString()); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥åæ´æ°å¤±è´¥" + result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else //æ´æ°erpä¿¡æ¯ |
| | | { |
| | | JObject jsonRoot = new JObject(); |
| | | jsonRoot.Add("Creator", ""); |
| | |
| | | } |
| | | jsonModel.Add("FDetailEntity", Entry); |
| | | jsonRoot.Add("Model", jsonModel); |
| | | var loginRet = InvokeHelper.Login(); |
| | | //ç»å½ |
| | | var loginRet = InvokeHelper.LoginUser(HMaker); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | if (isSuccess <= 0) |
| | | { |