/// <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);
        }
Exemple #2
0
        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);
        }