private string GetDealNoticeSend(Meituan_reqlog mlog) { var response = new MtpApiResponse(); response.partnerId = agentinfo.mt_partnerId.ConvertTo <int>(0); try { var data = JsonConvert.DeserializeObject <MtpOrderRefundedMessageRequest>(_requestParam.Replace("operator", "operator1")); if (data.body == null) { response.code = 300; response.describe = "Body数据解析失败"; } else { MtpOrderRefundedMessageRequestBody body = data.body; /* * 把电子票作废,数量清零 * 1.根据美团订单号得到系统订单号 * 2.根据系统订单号得到电子票 * 3.把电子票作废 */ int sysOrderid = new Meituan_reqlogData().GetSysorderidByMtorderid(body.orderId.ToString()); if (sysOrderid == 0) { //把这次操作计入日志文档中 LogHelper.RecordSelfLog("Error", "美团重要错误记录", "1--美团订单号:" + body.orderId + ",系统订单号:" + body.partnerOrderId + ",退款流水号:" + body.refundSerialNo + ",凭证码:" + String.Join(",", body.voucherList) + ",单张门票退款金额:" + body.refundPrice + ",已退款消息类型:" + body.refundMessageType + ",退款原因:" + body.reason + ",退款时间:" + body.refundTime + ",退款份数:" + body.count); } else { string pno = new SendEticketData().HuoQuEticketPno(sysOrderid); if (pno == "") { //把这次操作计入日志文档中 LogHelper.RecordSelfLog("Error", "美团重要错误记录", "2--美团订单号:" + body.orderId + ",系统订单号:" + body.partnerOrderId + ",退款流水号:" + body.refundSerialNo + ",凭证码:" + String.Join(",", body.voucherList) + ",单张门票退款金额:" + body.refundPrice + ",已退款消息类型:" + body.refundMessageType + ",退款原因:" + body.reason + ",退款时间:" + body.refundTime + ",退款份数:" + body.count); } else { try { string[] pnoarr = pno.Split(','); for (var i = 0; i < pnoarr.Length; i++) { if (pnoarr[i] != "") { //清空电子票数量 int r = new B2bEticketData().ClearPnoNum(pnoarr[i]); } } } catch { } //把这次操作计入日志文档中 LogHelper.RecordSelfLog("Error", "美团重要错误记录", "3--美团订单号:" + body.orderId + ",系统订单号:" + body.partnerOrderId + ",退款流水号:" + body.refundSerialNo + ",凭证码:" + String.Join(",", body.voucherList) + ",单张门票退款金额:" + body.refundPrice + ",已退款消息类型:" + body.refundMessageType + ",退款原因:" + body.reason + ",退款时间:" + body.refundTime + ",退款份数:" + body.count); } } } response.code = 200; response.describe = "successful"; response.partnerId = int.Parse(agentinfo.mt_partnerId); } catch (Exception ex) { response.code = 300; response.describe = "异常错误"; } string json = JsonConvert.SerializeObject(response); #region 把处理结果录入数据库 mlog.respstr = json; mlog.resptime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); mlog.code = response.code.ToString(); mlog.describe = response.describe; new Meituan_reqlogData().EditReqlog(mlog); #endregion return(json); }