| | |
| | | } |
| | | } |
| | | |
| | | //[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"; |