| | |
| | | } |
| | | } |
| | | |
| | | //[Route("POStockInBillList/AuditPOInStockBillPost")] |
| | | //[HttpGet] |
| | | //public object AuditPOInStockBill([FromBody] JObject msg) { |
| | | // string _msg = msg.ToString(); |
| | | [Route("POStockInBillList/AuditPOInStockBillPost")] |
| | | [HttpPost] |
| | | public object AuditPOInStockBill([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | string _msg = msg["msg"].ToString(); |
| | | _msg = _msg.Replace("\\", ""); |
| | | _msg = _msg.Replace("\n", ""); |
| | | List<Models.ReciveBill_FastModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ReciveBill_FastModel>>(_msg); |
| | | DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill(); |
| | | var hinterID = list[0].HInterID; |
| | | var FID = list[0].FID; |
| | | oCn.BeginTran(); |
| | | string sql = string.Empty; |
| | | foreach (var item in list) |
| | | { |
| | | if (item.HSQty == 0) |
| | | continue; |
| | | sql = $"update Cg_POInStockBillSub set Hqty = {item.HSQty} where HInterID ={item.HInterID} and HEntryID = {item.HEntryID}"; |
| | | oCn.RunProc(sql); |
| | | } |
| | | oCn.RunProc("exec h_p_Cg_UpDatePOOrderRelation_Del " + hinterID);//删除关联关系 |
| | | |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = s; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | JObject jsonRoot = new JObject(); |
| | | jsonRoot.Add("Creator", ""); |
| | | jsonRoot.Add("NeedUpDateFields", new JArray()); |
| | | jsonRoot.Add("NeedReturnFields", new JArray()); |
| | | jsonRoot.Add("IsDeleteEntry", "false"); |
| | | 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("FHQty ", item.HSQty); ; |
| | | Entry.Add(jsonFPOOrderEntry); |
| | | } |
| | | jsonModel.Add("FEntity", Entry); |
| | | jsonRoot.Add("Model", jsonModel); |
| | | var loginRet = InvokeHelper.Login(); |
| | | 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; |
| | | } |
| | | //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") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "金蝶收料通知单更新失败" + result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //更新成功后 同步更新金蝶 |
| | | oCn.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "操作成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 到货确认 扫条码 校验 |
| | |
| | | { |
| | | //校验条码是否存在 |
| | | string sql = $"select* from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode}'"; |
| | | DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList") ; |
| | | DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |