예제 #1
0
        public List <DictionaryVmodel> UpdateDirectlyMonthReportDetail(string rpts, string info, string strMonthReportID)
        {
            List <DictionaryVmodel>     ListObj = new List <DictionaryVmodel>();
            ReportInstance              rpt     = JsonHelper.Deserialize <ReportInstance>(rpts);
            MonthReportSummaryViewModel mrsvm   = JsonHelper.Deserialize <MonthReportSummaryViewModel>(info);
            MonthlyReportDetail         mrd     = rpt.ReportDetails.Find(p => p.ID == mrsvm.MonthlyDetailID);

            if (mrd != null)
            {
                MonthlyReportDetail tempMRD = mrd;
                tempMRD.NActualAmmount = (decimal)mrsvm.NActualAmmount;
                B_MonthlyReportDetail B_detail = CalculationEvaluationEngine.CalculationEvaluationService.Calculation(tempMRD.ToBModel(), "");
                B_MonthlyreportdetailOperator.Instance.UpdateMonthlyreportdetail(B_detail);
                rpt.ReportDetails.Remove(mrd);
                rpt.ReportDetails.Add(B_detail.ToVModel());
            }
            ListObj.Add(new DictionaryVmodel("ReportInstance", rpt));
            ListObj.Add(new DictionaryVmodel("MonthDetail", GetTargetDetailList(rpt, "", false)));
            ListObj.Add(new DictionaryVmodel("Misstarget", GetMissTargetList(rpt, strMonthReportID, true)));
            ListObj.Add(new DictionaryVmodel("MonthReportDescription", GetMonthTRptDescription(rpt)));
            ListObj.Add(new DictionaryVmodel("CurrentMissTargetList", GetCurrentMissTargetList(rpt, strMonthReportID.ToString(), true)));

            SaveJsonData(strMonthReportID.ToGuid(), rpt, ListObj);

            return(ListObj);
        }
예제 #2
0
        public List <DictionaryVmodel> UpdateMonthReportDetail(string rpts, string strMonthReportOrderType, string info, bool IncludeHaveDetail, string strMonthReportID)
        {
            List <DictionaryVmodel> ListObj  = new List <DictionaryVmodel>();
            MonthlyReportDetail     detail   = JsonHelper.Deserialize <MonthlyReportDetail>(info);
            B_MonthlyReportDetail   B_detail = CalculationEvaluationEngine.CalculationEvaluationService.Calculation(detail.ToBModel(), "");

            B_MonthlyreportdetailOperator.Instance.UpdateMonthlyreportdetail(B_detail);


            ReportInstance rpt = JsonHelper.Deserialize <ReportInstance>(rpts);

            rpt.ReportDetails.Remove(rpt.ReportDetails.Find(p => p.ID == detail.ID));
            rpt.ReportDetails.Add(B_detail.ToVModel());

            ListObj.Add(new DictionaryVmodel("ReportInstance", rpt));
            ListObj.Add(new DictionaryVmodel("MonthDetail", GetTargetDetailList(rpt, strMonthReportOrderType, IncludeHaveDetail)));
            ListObj.Add(new DictionaryVmodel("Misstarget", GetMissTargetList(rpt, strMonthReportID, true)));
            ListObj.Add(new DictionaryVmodel("MonthReportDescription", GetMonthTRptDescription(rpt)));
            ListObj.Add(new DictionaryVmodel("CurrentMissTargetList", GetCurrentMissTargetList(rpt, strMonthReportID.ToString(), true)));

            SaveJsonData(strMonthReportID.ToGuid(), rpt, ListObj);


            return(ListObj);
        }
예제 #3
0
        public List <DictionaryVmodel> UpdateProMonthReportDetail(string rpts, string strMonthReportOrderType, string info, bool IncludeHaveDetail, string strMonthReportID)
        {
            List <DictionaryVmodel> ListObj = new List <DictionaryVmodel>();

            //首先拿到数据
            ReportInstance rpt = JsonHelper.Deserialize <ReportInstance>(rpts);

            //在难道需要编辑的数据
            V_ProjectCompany ProDetail = JsonHelper.Deserialize <V_ProjectCompany>(info);

            //循环指标
            foreach (V_ProjectTarget item in ProDetail.ProjectTargets)
            {
                //获取修改的实体
                B_MonthlyReportDetail B_detail = B_MonthlyreportdetailOperator.Instance.GetMonthlyreportdetail(item.ProMonthlyReportDetailID);

                if (B_detail != null)
                {
                    B_detail.NActualAmmount             = item.NActualAmmount;             //当月实际值
                    B_detail.NAccumulativeActualAmmount = item.NAccumulativeActualAmmount; //当月实际累计值
                }
                //重新计算
                B_MonthlyReportDetail UpdateData = CalculationEvaluationEngine.CalculationEvaluationService.Calculation(B_detail, "");
                //修改数据
                B_MonthlyreportdetailOperator.Instance.UpdateMonthlyreportdetail(UpdateData);

                rpt.ReportDetails.Remove(rpt.ReportDetails.Find(p => p.ID == B_detail.ID));
                rpt.ReportDetails.Add(B_detail.ToVModel());
            }

            ListObj.Add(new DictionaryVmodel("ReportInstance", rpt));
            ListObj.Add(new DictionaryVmodel("MonthDetail", GetTargetDetailList(rpt, strMonthReportOrderType, IncludeHaveDetail)));
            ListObj.Add(new DictionaryVmodel("Misstarget", GetMissTargetList(rpt, strMonthReportID, true)));
            ListObj.Add(new DictionaryVmodel("MonthReportDescription", GetMonthTRptDescription(rpt)));
            ListObj.Add(new DictionaryVmodel("CurrentMissTargetList", GetCurrentMissTargetList(rpt, strMonthReportID.ToString(), true)));

            SaveJsonData(strMonthReportID.ToGuid(), rpt, ListObj);

            return(ListObj);
        }