public string setCareContent(string bizContent, long timeStamp, string signature) { MessageLog.WriteLog(new LogParameterModel { ClassName = this.GetType().ToString(), MethodName = "setCareContent", MethodParameters = $"bizContent:{bizContent},timeStamp:{timeStamp},signature:{signature}", LogLevel = ELogLevel.Info, Message = "接收参数", PathPrefix = "/log/ws", LogExt = "txt" }); var result = new ResultModel(); var paramItem = CommonLib.JsonHelper.Deserialize <SetNursingDto>(bizContent); if (paramItem == null) { result.resultCode = 0; result.resultMessage = "操作失败:bizContent不合法."; return(result.ToJSON()); } var HgID = paramItem.userId; var customerBll = new CustomerBll(); var itemCustomer = customerBll.GetVijObjectById(paramItem.welfareCentreId, paramItem.bedNumber); if (itemCustomer == null) { result.resultCode = 0; result.resultMessage = "未获得信息."; return(result.ToJSON()); } var arrayNursingIds = paramItem.nursingIds.Split(','); var list = new List <tbNursingPer>(); tbNursingPer item; var nowTime = DateTime.Now; Guid NursingMessageID = Guid.NewGuid(); foreach (var nursingId in arrayNursingIds) { if (!RegexValidate.IsInt(nursingId)) { continue; } item = new tbNursingPer(); item.ID = Guid.NewGuid(); item.CustomerID = itemCustomer.ID; item.NursingRankTopID = Convert.ToInt32(nursingId); item.NursingRankID = Convert.ToInt32(nursingId); item.HgID = HgID; item.OperatorUserID = HgID; item.NursingMessageID = NursingMessageID; item.NursingTime = nowTime; item.OperateDate = nowTime; item.CreateDate = nowTime; item.IsValid = 1; item.Remark = "cr"; item.WelfareCentreID = paramItem.welfareCentreId; list.Add(item); } var listExt = new List <tbNursingPerExt>(); tbNursingPerExt itemExt; var listNursingExt = JsonHelper.DeserializeToIList <nursingExtModel>(paramItem.nursingExt); if (listNursingExt != null) { foreach (var itemInfo in listNursingExt) { itemExt = new tbNursingPerExt(); itemExt.ID = Guid.NewGuid(); itemExt.CustomerID = itemCustomer.ID; itemExt.NursingRankTopID = itemInfo.nursingId; itemExt.NursingRankID = itemInfo.nursingId; itemExt.extTitle = itemInfo.extTitle; itemExt.extContent = itemInfo.extContent; itemExt.HgID = HgID; itemExt.OperatorUserID = HgID; itemExt.NursingTime = nowTime; itemExt.NursingMessageID = NursingMessageID; itemExt.OperateDate = nowTime; itemExt.CreateDate = nowTime; itemExt.IsValid = 1; itemExt.Remark = "cr"; itemExt.WelfareCentreID = paramItem.welfareCentreId; listExt.Add(itemExt); } } var cBll = new NursingPerBll(); var isFlag = cBll.AddAll(paramItem.welfareCentreId, HgID, itemCustomer.ID, list, listExt); if (isFlag) { result.resultCode = 1; result.resultMessage = "操作成功."; } else { result.resultCode = 0; result.resultMessage = "操作失败."; } return(result.ToJSON()); }
public string getCareContent(string bizContent, long timeStamp, string signature) { MessageLog.WriteLog(new LogParameterModel { ClassName = this.GetType().ToString(), MethodName = "getCareContent", MethodParameters = $"bizContent:{bizContent},timeStamp:{timeStamp},signature:{signature}", LogLevel = ELogLevel.Info, Message = "接收参数", PathPrefix = "/log/ws", LogExt = "txt" }); var result = new GetNursingVo(); var paramItem = CommonLib.JsonHelper.Deserialize <GetNursingDto>(bizContent); if (paramItem == null) { result.resultCode = 0; result.resultMessage = "操作失败:bizContent不合法."; return(result.ToJSON()); } var customerBll = new CustomerBll(); var itemCustomer = customerBll.GetVijObjectById(paramItem.welfareCentreId, paramItem.bedNumber); if (itemCustomer == null) { result.resultCode = 0; result.resultMessage = "未获得信息."; return(result.ToJSON()); } var prModel = new personModel(); prModel.userId = itemCustomer.ID; prModel.personName = itemCustomer.CustomerName; prModel.age = itemCustomer.CustomerAge ?? 0; prModel.gender = itemCustomer.CustomerGender == 1 ? "男" : "女"; var bufRemark = ""; var iteRemark = new PaymentPlanBll().GetById(itemCustomer.WelfareCentreID, itemCustomer.ID); if (iteRemark != null) { bufRemark = iteRemark.Remark; } prModel.remark = bufRemark.ToString(); result.person = prModel; var listNursing = new List <nursingModel>(); var fatherId = 1; var nursingRankBll = new NursingRankBll(); nursingModel itemNModel; var listNurs = nursingRankBll.SearchListByWhole(fatherId, paramItem.welfareCentreId); foreach (var itemInfo in listNurs) { itemNModel = new nursingModel(); itemNModel.nursingContent = itemInfo.RankContent; itemNModel.nursingId = itemInfo.ID; itemNModel.fatherId = itemInfo.ParentID ?? 0; itemNModel.nursingImgUrl = itemInfo.RankImgUrl; listNursing.Add(itemNModel); } result.nursing = listNursing; result.resultCode = 1; result.resultMessage = "操作成功."; return(result.ToJSON()); }