| | |
| | | JObject jsonModel = new JObject(); |
| | | jsonModel.Add("FID", FID); |
| | | JArray Entry = new JArray(); |
| | | |
| | | foreach (var item in list) |
| | | { |
| | | if (item.HSQty == 0) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //LogService.Write("jsonRoot:" + jsonRoot.ToString()); |
| | | 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; |
| | | } |
| | | var json = new |
| | | { |
| | | Ids = FID, |
| | | }; |
| | | //提交 |
| | | var _result = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject(json)); |
| | | var _saveObj = JObject.Parse(_result); |
| | | if (_saveObj["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; |
| | | |
| | | } |
| | | //审核 |
| | | _result = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json)); |
| | | _saveObj = JObject.Parse(_result); |
| | | if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | LogService.Write("收料通知单审核失败jsonRoot:" + jsonRoot.ToString()); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "金蝶收料通知单审核失败jsonRoot" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | |
| | | sql = string.Format(@"update Cg_POInStockBillMain set |
| | | HBillStatus = 2 , |
| | | HCheckDate = getdate() |
| | | where HInterID in ({0})", HInterID); |
| | | oCn.RunProc(sql);//更新mes状态 |
| | | //更新成功后 同步更新金蝶 |
| | | oCn.Commit(); |
| | | objJsonResult.code = "1"; |