/// <summary> /// P14社工服务记录 /// </summary> /// <param name="doc"></param> private void P14Operation(WordDocument doc) { long feeNo = 7; int careSvrId = 18; IResidentManageService residentManageService = IOCContainer.Instance.Resolve <IResidentManageService>(); ISocialWorkerManageService socialWorkerManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>(); IOrganizationManageService organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); ICarePlansManageService carePlansManageService = IOCContainer.Instance.Resolve <ICarePlansManageService>(); var resident = residentManageService.GetResident(feeNo); if (resident.Data == null) { return; } var person = residentManageService.GetPerson(resident.Data.RegNo ?? 0); var careSvr = socialWorkerManageService.GetCareSvrById(careSvrId); var emp = organizationManageService.GetEmployee(careSvr.Data.Carer); var org = organizationManageService.GetOrg(SecurityHelper.CurrentPrincipal.OrgId); var diaPR = carePlansManageService.GetDiaPR("001", careSvr.Data.QuestionLevel); CodeFilter request = new CodeFilter(); request.ItemTypes = new string[] { "K00.017", "E00.215", "E00.216", "E00.217" }; var dict = (List <CodeValue>)dictManageService.QueryCode(request).Data; doc.ReplaceText("Org", org.Data.OrgName); doc.ReplaceText("Name", person.Data.Name); doc.ReplaceText("FeeNo", feeNo.ToString()); //doc.ReplaceText("Inday", resident.Data.InDate.HasValue ? resident.Data.InDate.Value.ToString("yyyy-MM-dd") : ""); doc.ReplaceText("RoomNo", resident.Data.RoomNo); doc.ReplaceText("Area", resident.Data.Floor); doc.ReplaceText("RecDate", careSvr.Data.RecDate.HasValue ? careSvr.Data.RecDate.Value.ToString("yyyy-MM-dd") : ""); doc.ReplaceText("Carer", emp.Data.EmpName); doc.ReplaceText("SvrAddress", dict.Find(it => it.ItemType == "K00.017" && it.ItemCode == careSvr.Data.SvrAddress).ItemName); doc.ReplaceText("SvrType", dict.Find(it => it.ItemType == "E00.215" && it.ItemCode == careSvr.Data.SvrType).ItemName); doc.ReplaceText("SvrPeople", careSvr.Data.SvrPeople); doc.ReplaceText("RelationType", dict.Find(it => it.ItemType == "E00.216" && it.ItemCode == careSvr.Data.RelationType).ItemName); doc.ReplaceText("EvalStatus", dict.Find(it => it.ItemType == "E00.217" && it.ItemCode == careSvr.Data.EvalStatus).ItemName); doc.ReplaceText("EvalShour", careSvr.Data.EvalMinutes.HasValue ? ((decimal)careSvr.Data.EvalMinutes.Value / 60).ToString("F2") : ""); //doc.ReplaceText("H32_no", careSvrId.ToString()); doc.ReplaceText("ProcessActivity", careSvr.Data.ProcessActivity); //doc.ReplaceText("QuestionLevel", careSvr.Data.QuestionLevel); doc.ReplaceText("QuestionFocus", diaPR.Data.Find(it => it.ItemCode == careSvr.Data.QuestionFocus).ItemName); doc.ReplaceText("QuestionDesc", careSvr.Data.QuestionDesc); doc.ReplaceText("TreatDesc", careSvr.Data.TreatDesc); doc.ReplaceText("EvalDesc", careSvr.Data.EvalDesc); }
protected override void Operation(WordDocument doc) { int recordId = (int)ParamId; doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId)); ISocialWorkerManageService reportManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>(); IResidentManageService residentManageService = IOCContainer.Instance.Resolve <IResidentManageService>(); IOrganizationManageService organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); var question = reportManageService.GetRegEvaluateById(recordId).Data; if (question == null || !question.FeeNo.HasValue) { InitData(typeof(RegEvaluateModel), doc); doc.ReplaceText("BedNo", ""); doc.ReplaceText("Floor", ""); doc.ReplaceText("Name", ""); doc.ReplaceText("Age", ""); doc.ReplaceText("IllCard", ""); doc.ReplaceText("Service", ""); doc.ReplaceText("NextDate", ""); return; } var emp = organizationManageService.GetEmployee(question.EvaluateBy); doc.ReplaceText("EmpName", emp == null ? "" : emp.Data.EmpName); var request = new CodeFilter { ItemTypes = new[] { "E00.014", "E00.005", "E00.008", "E00.009", "E00.015", "E00.016", "E00.017", "E00.018", "E00.019", "E00.206", "E00.207", "E00.208", "E00.209", "E00.210", "E00.211" } }; var dict = (List <CodeValue>)dictManageService.QueryCode(request).Data; if (question.MindState != null) { doc.ReplaceText("MindState", dict.Find(it => it.ItemType == "E00.005" && it.ItemCode == question.MindState).ItemName); } if (question.ExpressionState != null) { doc.ReplaceText("ExpressionState", dict.Find(it => it.ItemType == "E00.008" && it.ItemCode == question.ExpressionState).ItemName); } if (question.LanguageState != null) { doc.ReplaceText("LanguageState", dict.Find(it => it.ItemType == "E00.015" && it.ItemCode == question.LanguageState).ItemName); } if (question.NonexpressionState != null) { doc.ReplaceText("NonexpressionState", dict.Find(it => it.ItemType == "E00.009" && it.ItemCode == question.NonexpressionState).ItemName); } if (question.EmotionState != null) { doc.ReplaceText("EmotionState", dict.Find(it => it.ItemType == "E00.016" && it.ItemCode == question.EmotionState).ItemName); } if (question.Personality != null) { doc.ReplaceText("Personality", dict.Find(it => it.ItemType == "E00.017" && it.ItemCode == question.Personality).ItemName); } if (question.Attention != null) { doc.ReplaceText("Attention", dict.Find(it => it.ItemType == "E00.018" && it.ItemCode == question.Attention).ItemName); } if (question.Realisticsense != null) { doc.ReplaceText("Realisticsense", dict.Find(it => it.ItemType == "E00.019" && it.ItemCode == question.Realisticsense).ItemName); } if (question.SocialParticipation != null) { doc.ReplaceText("SocialParticipation", dict.Find(it => it.ItemType == "E00.206" && it.ItemCode == question.SocialParticipation).ItemName); } if (question.SocialAttitude != null) { doc.ReplaceText("SocialAttitude", dict.Find(it => it.ItemType == "E00.207" && it.ItemCode == question.SocialAttitude).ItemName); } if (question.SocialSkills != null) { doc.ReplaceText("SocialSkills", dict.Find(it => it.ItemType == "E00.208" && it.ItemCode == question.SocialSkills).ItemName); } if (question.CommSkills != null) { doc.ReplaceText("CommSkills", dict.Find(it => it.ItemType == "E00.209" && it.ItemCode == question.CommSkills).ItemName); } if (question.ResponseSkills != null) { doc.ReplaceText("ResponseSkills", dict.Find(it => it.ItemType == "E00.210" && it.ItemCode == question.ResponseSkills).ItemName); } if (question.FixissueSkills != null) { doc.ReplaceText("FixissueSkills", dict.Find(it => it.ItemType == "E00.211" && it.ItemCode == question.FixissueSkills).ItemName); } if (question.BookDegree != null) { doc.ReplaceText("BookDegree", dict.Find(it => it.ItemType == "E00.014" && it.ItemCode == question.BookDegree).ItemName); } doc.ReplaceText("IllCard", question.IllCardName ?? ""); doc.ReplaceText("Service", question.ServiceName ?? ""); doc.ReplaceText("NextDate", question.NextEvalDate == null ? "" : ((DateTime)question.NextEvalDate).ToString("yyyy-MM-dd")); BindData(question, doc); var resident = residentManageService.GetResident(question.FeeNo.Value); if (resident != null && resident.Data != null) { doc.ReplaceText("BedNo", resident.Data.BedNo); doc.ReplaceText("Floor", resident.Data.Floor); } else { doc.ReplaceText("BedNo", ""); doc.ReplaceText("Floor", ""); } var person = residentManageService.GetPerson(question.RegNo ?? 0); if (person != null && person.Data != null) { doc.ReplaceText("Name", person.Data.Name); doc.ReplaceText("Age", person.Data.Age.ToString()); } else { doc.ReplaceText("Name", ""); doc.ReplaceText("Age", ""); } }
public IHttpActionResult Get(int feeNo) { var response = service.GetResident(feeNo); return(Ok(response)); }
protected override void Operation(WordDocument doc) { int careSvrId = (int)ParamId; doc.ReplaceText("Org", GetOrgName(SecurityHelper.CurrentPrincipal.OrgId)); IResidentManageService residentManageService = IOCContainer.Instance.Resolve <IResidentManageService>(); ISocialWorkerManageService socialWorkerManageService = IOCContainer.Instance.Resolve <ISocialWorkerManageService>(); IOrganizationManageService organizationManageService = IOCContainer.Instance.Resolve <IOrganizationManageService>(); IDictManageService dictManageService = IOCContainer.Instance.Resolve <IDictManageService>(); ICarePlansManageService carePlansManageService = IOCContainer.Instance.Resolve <ICarePlansManageService>(); var careSvr = socialWorkerManageService.GetCareSvrById(careSvrId); if (careSvr.Data == null || !careSvr.Data.FeeNo.HasValue) { InitData(typeof(CaresvrRecModel), doc); doc.ReplaceText("Name", ""); doc.ReplaceText("Inday", ""); doc.ReplaceText("Dormitory", ""); return; } CodeFilter request = new CodeFilter { ItemTypes = new string[] { "K00.017", "E00.215", "E00.216", "E00.217" } }; var dict = (List <CodeValue>)dictManageService.QueryCode(request).Data; if (careSvr.Data.SvrAddress != null) { careSvr.Data.SvrAddress = dict.Find(it => it.ItemType == "K00.017" && it.ItemCode == careSvr.Data.SvrAddress).ItemName; } if (careSvr.Data.SvrType != null) { careSvr.Data.SvrType = dict.Find(it => it.ItemType == "E00.215" && it.ItemCode == careSvr.Data.SvrType).ItemName; } if (careSvr.Data.RelationType != null) { careSvr.Data.RelationType = dict.Find(it => it.ItemType == "E00.216" && it.ItemCode == careSvr.Data.RelationType).ItemName; } if (careSvr.Data.EvalStatus != null) { careSvr.Data.EvalStatus = dict.Find(it => it.ItemType == "E00.217" && it.ItemCode == careSvr.Data.EvalStatus).ItemName; } if (careSvr.Data.QuestionFocus != null) { if (careSvr.Data.QuestionLevel != null) { var diaPr = carePlansManageService.GetDiaPR("001", careSvr.Data.QuestionLevel); if (diaPr != null && diaPr.Data != null) { careSvr.Data.QuestionFocus = diaPr.Data.Find(it => it.ItemCode == careSvr.Data.QuestionFocus).ItemName; } } } if (careSvr.Data.Carer != null) { var emp = organizationManageService.GetEmployee(careSvr.Data.Carer); if (emp != null) { careSvr.Data.Carer = emp.Data.EmpName; } } BindData(careSvr.Data, doc); var resident = residentManageService.GetResident(careSvr.Data.FeeNo.Value); if (resident != null && resident.Data != null) { doc.ReplaceText("Inday", resident.Data.InDate.HasValue ? resident.Data.InDate.Value.ToString("yyyy-MM-dd") : ""); doc.ReplaceText("Dormitory", resident.Data.BedNo); } else { doc.ReplaceText("Inday", ""); doc.ReplaceText("Dormitory", ""); } var person = residentManageService.GetPerson(careSvr.Data.RegNo ?? 0); if (person != null && person.Data != null) { doc.ReplaceText("Name", person.Data.Name); } else { doc.ReplaceText("Name", ""); } //doc.ReplaceText("FeeNo", feeNo.ToString()); //doc.ReplaceText("EvalMinutes", careSvr.Data.EvalMinutes.HasValue ? ((decimal)careSvr.Data.EvalMinutes.Value / 60).ToString("F2") : ""); //doc.ReplaceText("RecDate", careSvr.Data.RecDate.HasValue ? careSvr.Data.RecDate.Value.ToString("yyyy-MM-dd") : ""); //doc.ReplaceText("SvrPeople", careSvr.Data.SvrPeople); //doc.ReplaceText("Id", careSvrId.ToString()); //doc.ReplaceText("ProcessActivity", careSvr.Data.ProcessActivity); //doc.ReplaceText("QuestionLevel", careSvr.Data.QuestionLevel); //doc.ReplaceText("QuestionDesc", careSvr.Data.QuestionDesc); //doc.ReplaceText("TreatDesc", careSvr.Data.TreatDesc); //doc.ReplaceText("EvalDesc", careSvr.Data.EvalDesc); }