public JsonResult AddressApproveSelected(List <string> Ids) { var channel = PreApprovalClientChannelFactory.GetChannel(); P_AddressApproval addressApproval = new P_AddressApproval(); P_AddressApproval_View addressApproval_View = new P_AddressApproval_View(); var preApprovalChannel = PreApprovalClientChannelFactory.GetChannel(); P_USERINFO userInfo = Session[MealH5.Util.ConstantHelper.CURRENTWXUSER] as P_USERINFO; try { foreach (var id in Ids) { addressApproval_View = channel.LoadAddressApprovalInfo(Guid.Parse(id)); var res = preApprovalChannel.AddressApprove(addressApproval_View, ""); if (res == 1) { P_AddressApproveHistory addressApproveHistory = new P_AddressApproveHistory() { ID = Guid.NewGuid(), DA_ID = Guid.Parse(id), UserName = userInfo.Name, UserId = userInfo.UserId, ActionType = 1, ApproveDate = DateTime.Now, Comments = "", type = 0, IsDelete = 0 }; //添加审批记录 //var historyRes = preApprovalChannel.AddAddressApproveHistory(addressApproveHistory); //if (historyRes == 0) //{ // LogHelper.Info($"审批成功,添加审批记录失败 - [{ id},{userInfo.UserId}]"); //} // 发用户消息 addressApproval.ID = Guid.Parse(id); WxMessageHandler.GetInstance().SendAddressApprovalStateChangeMessageToUser(addressApproval); LogHelper.Info($"地址申请审批通过 - [{ id},{userInfo.UserId}]"); } else { LogHelper.Info($" 审批地址申请失败 - [{id}]"); } } return(Json(new { state = 1, txt = "地址申请审批通过。" })); } catch (Exception ex) { LogHelper.Error("Exception AddressApprove", ex); return(Json(new { state = 0, txt = "地址申请审批失败,请刷新页面后重试。", errCode = 9007 })); } }
public JsonResult SendSpecialWxMessage(Guid id) { P_AddressApproval addressApproval = new P_AddressApproval(); addressApproval.ID = id; P_AddressApproval_View addressApproval_View = new P_AddressApproval_View(); var preApprovalChannel = PreApprovalClientChannelFactory.GetChannel(); var channel = PreApprovalClientChannelFactory.GetChannel(); addressApproval_View = channel.LoadAddressApprovalInfo(id); P_USERINFO userInfo = Session[MealH5.Util.ConstantHelper.CURRENTWXUSER] as P_USERINFO; string msg = ""; try { var res = preApprovalChannel.AddressApprove(addressApproval_View, "该医院已被删除"); if (res == 1) { P_AddressApproveHistory addressApproveHistory = new P_AddressApproveHistory() { ID = Guid.NewGuid(), DA_ID = id, UserName = userInfo.Name, UserId = userInfo.UserId, ActionType = 2, ApproveDate = DateTime.Now, Comments = "该医院已被删除", type = 0, IsDelete = 0 }; WxMessageHandler.GetInstance().SendSpecialMessageToUser(addressApproval); return(Json(new { state = 1, txt = msg })); } else { LogHelper.Info($" 审批地址申请失败 - [{id}]"); return(Json(new { state = 0, txt = "地址申请审批失败,请刷新页面后重试。", errCode = 9007 })); } } catch (Exception ex) { LogHelper.Error("Exception SendWxMessage", ex); return(Json(new { state = 0, txt = "", errCode = 9007 })); } }
public int AddressApprove(P_AddressApproval_View p_addressApproval_View, string reason) { return(preApprovalService.AddressApprove(p_addressApproval_View, reason)); }
public JsonResult AddressApprove(Guid id, int action, string reason) { P_AddressApproval addressApproval = new P_AddressApproval(); addressApproval.ID = id; P_AddressApproval_View addressApproval_View = new P_AddressApproval_View(); var preApprovalChannel = PreApprovalClientChannelFactory.GetChannel(); var channel = PreApprovalClientChannelFactory.GetChannel(); addressApproval_View = channel.LoadAddressApprovalInfo(id); P_USERINFO userInfo = Session[MealH5.Util.ConstantHelper.CURRENTWXUSER] as P_USERINFO; string msg = ""; try { var res = preApprovalChannel.AddressApprove(addressApproval_View, reason); if (res == 1) { P_AddressApproveHistory addressApproveHistory = new P_AddressApproveHistory() { ID = Guid.NewGuid(), DA_ID = id, UserName = userInfo.Name, UserId = userInfo.UserId, ActionType = action, ApproveDate = DateTime.Now, Comments = reason, type = 0, IsDelete = 0 }; //添加审批记录 //var historyRes = preApprovalChannel.AddAddressApproveHistory(addressApproveHistory); //if (historyRes == 0) //{ // LogHelper.Info($"审批成功,添加审批记录失败 - [{ id},{userInfo.UserId}]"); //} // 发用户消息 WxMessageHandler.GetInstance().SendAddressApprovalStateChangeMessageToUser(addressApproval); LogHelper.Info($"地址申请审批通过 - [{ id},{userInfo.UserId}]"); if (reason == "") { if (addressApproval_View.ApprovalStatus == 0) { msg = "地址申请审批通过。"; } else if (addressApproval_View.ApprovalStatus == 9) { msg = "地址申请修改审批通过。"; } else if (addressApproval_View.ApprovalStatus == 10) { msg = "地址申请重新提交审批通过。"; } } else { if (addressApproval_View.ApprovalStatus == 0) { msg = "地址申请审批驳回。"; } else if (addressApproval_View.ApprovalStatus == 9) { msg = "地址申请修改审批驳回。"; } else if (addressApproval_View.ApprovalStatus == 10) { msg = "地址申请重新提交审批驳回。"; } } return(Json(new { state = 1, txt = msg })); } else { LogHelper.Info($" 审批地址申请失败 - [{id}]"); return(Json(new { state = 0, txt = "地址申请审批失败,请刷新页面后重试。", errCode = 9007 })); } }catch (Exception ex) { LogHelper.Error("Exception AddressApprove", ex); return(Json(new { state = 0, txt = "地址申请审批失败,请刷新页面后重试。", errCode = 9007 })); } }
public int AddressApprove(P_AddressApproval_View p_addressApproval_View, string reason) { return(PreApprovalDao.AddressApprove(p_addressApproval_View, reason)); }