public async Task<ActionResult> BizCheck04(BizCheck04ViewModel bizCheck04ViewModel)
        {
            ViewBag.LeftMenu = Global.Report;
            int questionSn = bizCheck04ViewModel.QuestionSn;

            if (bizCheck04ViewModel.QuestionSn > 0)
            {
                var quesMaster = await _quesMasterService.GetQuesResult1Async(questionSn);

                if (bizCheck04ViewModel.SubmitType == "N")
                {
                    quesMaster.SaveStatus = 7;
                }

                //근로환경 저장 또는 업데이트 정보 설정
                foreach (var item in bizCheck04ViewModel.WorkEnv)
                {
                    var checkItem = quesMaster.QuesResult1.SingleOrDefault(m => m.QuestionSn == questionSn && m.CheckListSn == item.CheckListSn);
                    if (checkItem == null)
                    {
                        var result1 = new QuesResult1();
                        result1.QuestionSn = questionSn;
                        result1.CheckListSn = item.CheckListSn;
                        result1.AnsVal = item.AnsVal;
                        result1.RegDt = DateTime.Now;
                        result1.RegId = Session[Global.LoginID].ToString();
                        quesMaster.QuesResult1.Add(result1);
                    }
                    else
                    {
                        checkItem.AnsVal = item.AnsVal;
                        checkItem.UpdDt = DateTime.Now;
                        checkItem.UpdId = Session[Global.LoginID].ToString();
                    }
                }

                //조직만족도 저장 또는 업데이트 정보 설정
                var quesYearMaster = await _quesMasterService.GetQuesResult2Async(questionSn);

                //총직원
                var yearTotalItem = quesYearMaster.QuesResult2.SingleOrDefault(m => m.QuestionSn == questionSn && m.CheckListSn == bizCheck04ViewModel.TotalEmp.CheckListSn);
                if (yearTotalItem == null)
                {
                    var quesYearTotalEmp = Mapper.Map<QuesResult2>(bizCheck04ViewModel.TotalEmp);
                    quesYearTotalEmp.QuestionSn = questionSn;
                    quesYearTotalEmp.RegDt = DateTime.Now;
                    quesYearTotalEmp.RegId = Session[Global.LoginID].ToString();
                    quesYearTotalEmp.BasicYear = quesYearMaster.BasicYear;
                    quesYearMaster.QuesResult2.Add(quesYearTotalEmp);
                }
                else
                {
                    yearTotalItem.D = bizCheck04ViewModel.TotalEmp.D;
                    yearTotalItem.D451 = bizCheck04ViewModel.TotalEmp.D451;
                    yearTotalItem.D452 = bizCheck04ViewModel.TotalEmp.D452;
                    yearTotalItem.D453 = bizCheck04ViewModel.TotalEmp.D453;
                    yearTotalItem.UpdDt = DateTime.Now;
                    yearTotalItem.UpdId = Session[Global.LoginID].ToString();
                }


                //이직직원
                var yearMoveItem = quesYearMaster.QuesResult2.SingleOrDefault(m => m.QuestionSn == questionSn && m.CheckListSn == bizCheck04ViewModel.MoveEmp.CheckListSn);
                if (yearMoveItem == null)
                {
                    var quesYearMoveEmp = Mapper.Map<QuesResult2>(bizCheck04ViewModel.MoveEmp);
                    quesYearMoveEmp.QuestionSn = questionSn;
                    quesYearMoveEmp.RegDt = DateTime.Now;
                    quesYearMoveEmp.RegId = Session[Global.LoginID].ToString();
                    quesYearMoveEmp.BasicYear = quesYearMaster.BasicYear;
                    quesYearMaster.QuesResult2.Add(quesYearMoveEmp);
                }
                else
                {
                    yearMoveItem.D = bizCheck04ViewModel.MoveEmp.D;
                    yearMoveItem.D451 = bizCheck04ViewModel.MoveEmp.D451;
                    yearMoveItem.D452 = bizCheck04ViewModel.MoveEmp.D452;
                    yearMoveItem.D453 = bizCheck04ViewModel.MoveEmp.D453;
                    yearMoveItem.UpdDt = DateTime.Now;
                    yearMoveItem.UpdId = Session[Global.LoginID].ToString();
                }

                //신규직원
                var yearNewItem = quesYearMaster.QuesResult2.SingleOrDefault(m => m.QuestionSn == questionSn && m.CheckListSn == bizCheck04ViewModel.NewEmp.CheckListSn);
                if (yearNewItem == null)
                {
                    var quesYearNewEmp = Mapper.Map<QuesResult2>(bizCheck04ViewModel.NewEmp);
                    quesYearNewEmp.QuestionSn = questionSn;
                    quesYearNewEmp.RegDt = DateTime.Now;
                    quesYearNewEmp.RegId = Session[Global.LoginID].ToString();
                    quesYearNewEmp.BasicYear = quesYearMaster.BasicYear;
                    quesYearMaster.QuesResult2.Add(quesYearNewEmp);
                }
                else
                {
                    yearNewItem.D = bizCheck04ViewModel.NewEmp.D;
                    yearNewItem.D451 = bizCheck04ViewModel.NewEmp.D451;
                    yearNewItem.D452 = bizCheck04ViewModel.NewEmp.D452;
                    yearNewItem.D453 = bizCheck04ViewModel.NewEmp.D453;
                    yearNewItem.UpdDt = DateTime.Now;
                    yearNewItem.UpdId = Session[Global.LoginID].ToString();
                }

                await _quesMasterService.SaveDbContextAsync();
            }
            else
            {
                //에러처리 필요
                return View(bizCheck04ViewModel);
            }

            if (bizCheck04ViewModel.SubmitType == "T")
            {
                return RedirectToAction("BizCheck04", "Report", new { @questionSn = questionSn });
            }
            else
            {
                return RedirectToAction("BizCheck05", "Report", new { @questionSn = questionSn });
            }
        }
        public async Task<ActionResult> BizCheck04(string questionSn, string status)
        {
            ViewBag.LeftMenu = Global.Report;

            if (string.IsNullOrEmpty(questionSn))
            {
                // 오류 처리해야함.
                return View();
            }

            var bizCheck04 = new BizCheck04ViewModel();

            // A1A201 : 근로환경
            var quesResult1s = await _quesResult1Service.GetQuesResult1sAsync(int.Parse(questionSn), "A1A201");

            if (quesResult1s.Count() != 6)
            {
                var quesCheckList = await _quesCheckListService.GetQuesCheckListAsync("A1A201");
                var quesCheckListView = Mapper.Map<List<QuesCheckListViewModel>>(quesCheckList);

                foreach (var item in quesCheckListView)
                {
                    item.QuestionSn = int.Parse(questionSn);
                    item.AnsVal = false;
                }

                bizCheck04.WorkEnv = quesCheckListView;
            }
            else
            {
                var quesCheckListView = Mapper.Map<List<QuesCheckListViewModel>>(quesResult1s);
                bizCheck04.WorkEnv = quesCheckListView;
            }

            // A1A202 : 조직만족도
            var quesResult2s = await _quesResult2Service.GetQuesResult2sAsync(int.Parse(questionSn), "A1A202");

            if (quesResult2s.Count() != 3)
            {
                var quesCheckList = await _quesCheckListService.GetQuesCheckListAsync("A1A202");
                var quesYearListView = Mapper.Map<List<QuesYearListViewModel>>(quesCheckList);

                foreach (var item in quesYearListView)
                {
                    item.QuestionSn = int.Parse(questionSn);
                    item.BasicYear = DateTime.Now.Year;
                    item.D = "0";
                    item.D451 = "0";
                    item.D452 = "0";
                    item.D453 = "0";
                }
                //총직원
                bizCheck04.TotalEmp = quesYearListView.SingleOrDefault(i => i.DetailCd == "A1A20201");
                //이직직원
                bizCheck04.MoveEmp = quesYearListView.SingleOrDefault(i => i.DetailCd == "A1A20202");
                //신규직원
                bizCheck04.NewEmp = quesYearListView.SingleOrDefault(i => i.DetailCd == "A1A20203");
            }
            else
            {
                var quesYearListView = Mapper.Map<List<QuesYearListViewModel>>(quesResult2s);
                //총직원
                bizCheck04.TotalEmp = quesYearListView.SingleOrDefault(i => i.DetailCd == "A1A20201");
                //이직직원
                bizCheck04.MoveEmp = quesYearListView.SingleOrDefault(i => i.DetailCd == "A1A20202");
                //신규직원
                bizCheck04.NewEmp = quesYearListView.SingleOrDefault(i => i.DetailCd == "A1A20203");
            }

            bizCheck04.Status = status;
            bizCheck04.QuestionSn = int.Parse(questionSn);
            return View(bizCheck04);
        }