コード例 #1
0
        public Result <int> UpdateTzProjectPolit(Epm_TzProjectPolit model)
        {
            Result <int> result = new Result <int>();

            try
            {
                var Poli = DataOperateBusiness <Epm_TzProjectPolit> .Get().Single(p => p.Id == model.Id);

                SetCurrentUser(model);

                #region 协同接口
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    ProjectApprovalApplyView view = new ProjectApprovalApplyView();
                    view.txt_xmmc = model.ProjectName;

                    if (model.CompanyId != null)
                    {
                        var company = DataOperateBasic <Base_Company> .Get().GetModel(model.CompanyId.Value);

                        if (company == null)
                        {
                            throw new Exception("未获取到申请单位信息!");
                        }
                        view.sub_sqdw = company.ObjeId;
                    }
                    else
                    {
                        throw new Exception("请选择申请单位!");
                    }

                    view.date_kgrq   = string.Format("{0:yyyy-MM-dd}", model.StartDate);
                    view.date_jgrq   = string.Format("{0:yyyy-MM-dd}", model.EndDate);
                    view.date_ysrq   = string.Format("{0:yyyy-MM-dd}", model.AcceptDate);
                    view.date_zgrq   = string.Format("{0:yyyy-MM-dd}", model.RectFinishDate);
                    view.date_jssj   = string.Format("{0:yyyy-MM-dd}", model.FinalDate);
                    view.date_sjsj   = string.Format("{0:yyyy-MM-dd}", model.AuditDate);
                    view.txts_zlsfqq = model.FullFiles;
                    view.txt_ysyj    = model.AcceptOpinion;
                    view.date_sqrq   = string.Format("{0:yyyy-MM-dd}", DateTime.Now);

                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    view.hr_sqr  = baseUser.ObjeId;
                    view.file_fj = "";
                    if (model.TzAttachs.Count > 0)
                    {
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    switch (item.TypeNo)
                        //    {
                        //        case "SBJJ":        // 销售企业二级单位验收主要事项表
                        //            view.file_fj = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //            break;
                        //        case "SGSC":        // 施工转生产界面交接确认单
                        //            view.file_sgdw = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //            break;
                        //        case "GCJJ":        // 工程交接证书
                        //            view.file_gcjjzs = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //            break;
                        //        default:
                        //            break;
                        //    }
                        //}
                        //销售企业二级单位验收主要事项表
                        var sxbTemp = model.TzAttachs.Where(p => p.TypeNo == "KGSQXSQYEJ").ToList();
                        view.file_fj = XtWorkFlowSubmitService.CreateXtAttachPath(sxbTemp);
                        //施工转生产界面交接确认单
                        var qrdTemp = model.TzAttachs.Where(p => p.TypeNo == "KGSQSGZSCJM").ToList();
                        view.file_fj = XtWorkFlowSubmitService.CreateXtAttachPath(qrdTemp);
                        //工程交接证书
                        var jjzsTemp = model.TzAttachs.Where(p => p.TypeNo == "KGSQGCJJZS").ToList();
                        view.file_fj = XtWorkFlowSubmitService.CreateXtAttachPath(jjzsTemp);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateApplyWorkFlow(view);
                }
                #endregion
                var rows = DataOperateBusiness <Epm_TzProjectPolit> .Get().Update(model);

                //上传附件
                AddFilesBytzTable(model, model.TzAttachs);
                result.Data = rows;
                result.Flag = EResultFlag.Success;
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "UpdateTzConDrawing");
            }
            return(result);
        }
コード例 #2
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddTzTenderingApply(Epm_TzTenderingApply model)
        {
            Result <int> result = new Result <int>();

            try
            {
                SetCreateUser(model);
                SetCurrentUser(model);

                //上传附件
                AddFilesBytzTable(model, model.TzAttachs);

                #region  招标申请协同接口
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    XtTzTenderingApplyView view = new XtTzTenderingApplyView();

                    view.ProjectName         = model.ProjectName;
                    view.UndertakeDepartment = model.UndertakeDepartment;
                    view.UndertakeContacts   = model.UndertakeContacts;
                    view.UndertakeTel        = model.UndertakeTel;
                    view.Minutes             = model.ApprovalNo;
                    view.TenderingName       = model.TenderingName;
                    view.TenderingType       = model.TenderingType;
                    view.BidName             = model.BidName;
                    view.CapitalBudget       = model.CapitalBudget;
                    view.ProjectSummary      = model.ProjectSummary;
                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    view.hr_sqr = baseUser.ObjeId;
                    //上传附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    //string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    //view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //    string fileUrl = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //}

                        //if (view.Temp_TzAttachs != null)
                        //{
                        //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                        //}
                        view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateTzTenderingApplyWorkFlow(view);
                }
                #endregion

                var rows = DataOperateBusiness <Epm_TzTenderingApply> .Get().Add(model);


                result.Data = rows;
                result.Flag = EResultFlag.Success;
                //WriteLog(AdminModule.TzTenderingApply.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddTzTenderingApply");
            }
            return(result);
        }
コード例 #3
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddMeetingFileReport(Epm_MeetingFileReport model)
        {
            Result <int> result = new Result <int>();

            try
            {
                int  rows    = 0;
                bool isAdd   = false;
                var  meeting = DataOperateBusiness <Epm_MeetingFileReport> .Get().GetList(t => t.ProjectId == model.ProjectId && t.State != (int)PreProjectState.ApprovalFailure && t.State != (int)PreProjectState.Discarded).FirstOrDefault();

                if (meeting == null)
                {
                    isAdd   = true;
                    meeting = new Epm_MeetingFileReport();
                    SetCreateUser(meeting);
                }
                meeting.ProjectId = model.ProjectId;
                meeting.State     = model.State;
                SetCurrentUser(meeting);

                //上传附件
                AddFilesBytzTable(meeting, model.TzAttachs);

                var projectInfo = DataOperateBusiness <Epm_TzProjectProposal> .Get().GetModel(model.ProjectId);

                //特许经营项目性质的项目审批到项目批复完成就结束了,不生成工程模块的内容,不用写到机器人表里
                if (projectInfo.Nature != "XMXZTXJY")
                {
                    #region   会材料上报流程申请
                    var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                    if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                    {
                        TzMeetingFileReportWorkFlowView view = new TzMeetingFileReportWorkFlowView();
                        var project = DataOperateBusiness <Epm_TzProjectProposal> .Get().GetModel(model.ProjectId);

                        view.ProjectName   = project.ProjectName;
                        view.StationName   = project.StationName;
                        view.NatureName    = project.NatureName;
                        view.Position      = project.Position;
                        view.ApplyTime     = string.Format("{0:yyyy-MM-dd}", project.ApplyTime);
                        view.CompanyName   = project.CompanyName;
                        view.PredictMoney  = project.PredictMoney.ToString();
                        view.OilSalesTotal = project.OilSalesTotal.ToString();
                        view.CNGY          = model.CNG.ToString();
                        view.LNGQ          = model.LNG.ToString();
                        var baseUser = DataOperateBasic <Base_User> .Get().GetModel(meeting.CreateUserId);

                        if (baseUser == null)
                        {
                            throw new Exception("未找到申请人相关信息!");
                        }

                        view.hr_sqr = baseUser.ObjeId;
                        //上传附件
                        if (model.TzAttachs != null && model.TzAttachs.Any())
                        {
                            //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                            //foreach (var item in model.TzAttachs)
                            //{
                            //    string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                            //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;

                            //}

                            //if (view.Temp_TzAttachs != null)
                            //{
                            //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                            //}
                            view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                        }

                        meeting.WorkFlowId = XtWorkFlowService.CreateMeetingFileReportWorkFlow(view);
                    }
                    #endregion
                }

                if (isAdd)
                {
                    rows = DataOperateBusiness <Epm_MeetingFileReport> .Get().Add(meeting);
                }
                else
                {
                    rows = DataOperateBusiness <Epm_MeetingFileReport> .Get().Update(meeting);
                }


                result.Data = rows;
                result.Flag = EResultFlag.Success;
                //WriteLog(AdminModule.MeetingFileReport.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddMeetingFileReport");
            }
            return(result);
        }
コード例 #4
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddTzPeopleChgApply(Epm_TzPeopleChgApply model)
        {
            Result <int> result = new Result <int>();

            try
            {
                model = SetCurrentUser(model);
                model = SetCreateUser(model);

                #region 建设工程项目管理人员变更申请流程
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectApprovalState.WaitApproval && XtWorkFlow == "1")
                {
                    TzPeopleChgApplyView view = new TzPeopleChgApplyView();

                    if (model.ApplicantId != null)
                    {
                        var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.ApplicantId.Value);

                        if (baseUser == null)
                        {
                            throw new Exception("未找到申请人相关信息!");
                        }
                        view.hr_sqr = baseUser.ObjeId;
                    }

                    if (model.DepartmentId != null)
                    {
                        var company = DataOperateBasic <Base_Company> .Get().GetModel(model.DepartmentId.Value);

                        if (company == null)
                        {
                            throw new Exception("未获取到申请部门信息!");
                        }
                        view.dep_sqbm = company.ObjeId;
                    }
                    else
                    {
                        throw new Exception("请选择申请部门!");
                    }

                    if (model.CompanyId != null)
                    {
                        var company = DataOperateBasic <Base_Company> .Get().GetModel(model.CompanyId.Value);

                        if (company == null)
                        {
                            throw new Exception("未获取到申请单位信息!");
                        }
                        view.sub_sqdw = company.ObjeId;
                    }
                    else
                    {
                        throw new Exception("请选择申请单位!");
                    }

                    view.date_sqrq = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    view.txt_xmmc  = model.ProjectName;
                    view.txt_jsdz  = model.ConstructionAddress;
                    view.sub_sgdw  = model.WorkUnit;
                    view.txt_fzr   = model.Leader;

                    if (model.LeaderId != null)
                    {
                        var baseUserHeaderID = DataOperateBasic <Base_User> .Get().GetModel(model.LeaderId.Value);

                        if (baseUserHeaderID == null)
                        {
                            throw new Exception("未找到分管领导相关信息!");
                        }
                        view.hr_fgld = baseUserHeaderID.ObjeId;
                    }
                    if (model.DepLeaderId != null)
                    {
                        var baseUserLeaderID = DataOperateBasic <Base_User> .Get().GetModel(model.DepLeaderId.Value);

                        if (baseUserLeaderID == null)
                        {
                            throw new Exception("未找到部门负责人相关信息!");
                        }
                        view.hr_bmfzr = baseUserLeaderID.ObjeId;
                    }

                    //明细表信息
                    if (model.TzPeopleChgApplyItem != null && model.TzPeopleChgApplyItem.Any())
                    {
                        view.list = new List <TzPeopleChgApplyView.TzPeopleChgApplyItem>();
                        foreach (var temp in model.TzPeopleChgApplyItem)
                        {
                            TzPeopleChgApplyView.TzPeopleChgApplyItem itemview = new TzPeopleChgApplyView.TzPeopleChgApplyItem();
                            itemview.txt_bgqzyzsmc = temp.ChgCertiNameBefore;
                            itemview.txt_bghzyzsmc = temp.ChgCertiNameAfter;
                            itemview.txt_bggw      = temp.ChgPost;
                            itemview.txt_bgqry     = temp.ChgPeopleBefore;
                            itemview.txt_bghry     = temp.ChgPeopleAfter;
                            itemview.txt_bgqzyzsh  = temp.ChgCertiNoBefore;
                            itemview.txt_bghzyzsh  = temp.ChgCertiNoAfter;

                            view.list.Add(itemview);
                        }
                    }
                    //附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    switch (item.TypeNo)
                        //    {
                        //        case "RYBGFJ":
                        //            view.fj = fileUrl + '|' + view.fj; ;
                        //            break;
                        //        default:
                        //            break;
                        //    }
                        //}
                        //if (view.fj != null)
                        //{
                        //    view.fj = view.fj.Substring(view.fj.Length - 1);
                        //}
                        var fileList = model.TzAttachs.Where(p => p.TypeNo == "RYBGFJ").ToList();
                        view.fj = XtWorkFlowSubmitService.CreateXtAttachPath(fileList);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateTzPeopleChgApplyWorkFlow(view);
                }
                #endregion

                var rows = DataOperateBusiness <Epm_TzPeopleChgApply> .Get().Add(model);

                if (model.TzPeopleChgApplyItem != null && model.TzPeopleChgApplyItem.Any())
                {
                    model.TzPeopleChgApplyItem.ForEach(item =>
                    {
                        item.ChangeApplyId = model.Id;
                        item = SetCurrentUser(item);
                        item = SetCreateUser(item);
                    });
                    DataOperateBusiness <Epm_TzPeopleChgApplyItem> .Get().AddRange(model.TzPeopleChgApplyItem);
                }
                //上传附件
                if (model.TzAttachs != null && model.TzAttachs.Any())
                {
                    AddFilesBytzTable(model, model.TzAttachs);
                }
                result.Data = rows;
                result.Flag = EResultFlag.Success;
                //WriteLog(AdminModule.TzPeopleChgApply.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddTzPeopleChgApply");
            }
            return(result);
        }
コード例 #5
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddTzDesiginChangeApply(Epm_TzDesiginChangeApply model)
        {
            Result <int> result = new Result <int>();

            try
            {
                #region 建设工程设计变更申请流程
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.ApprovalSuccess && XtWorkFlow == "1")
                {
                    TzDesiginChangeApplyApprovalView view = new TzDesiginChangeApplyApprovalView();

                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.ApplicantID.Value);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    if (model.UnitID != null)
                    {
                        var company = DataOperateBasic <Base_Company> .Get().GetModel(model.UnitID.Value);

                        if (company == null)
                        {
                            throw new Exception("未获取到申请单位信息!");
                        }
                        view.sub_sqdw = company.ObjeId;
                    }
                    else
                    {
                        throw new Exception("请选择申请单位!");
                    }

                    view.hr_sqr    = baseUser.ObjeId;
                    view.date_sqrq = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    view.txt_gcmc  = model.ProjectName;
                    view.int_htzj  = model.InvestmentCost.ToString();
                    view.int_bgzj  = model.ChangeCost.ToString();
                    //view.sub_jswd = model.ConstructionUnit;

                    if (model.ConstructionUnitID != null)
                    {
                        var company = DataOperateBasic <Base_Company> .Get().GetModel(model.ConstructionUnitID.Value);

                        if (company == null)
                        {
                            throw new Exception("未获取到申请单位信息!");
                        }
                        view.sub_jswd = company.ObjeId;
                    }
                    else
                    {
                        throw new Exception("请选择申请单位!");
                    }

                    if (model.DepartmentID != null)
                    {
                        var company = DataOperateBasic <Base_Company> .Get().GetModel(model.DepartmentID.Value);

                        if (company == null)
                        {
                            throw new Exception("未获取到申请部门信息!");
                        }
                        view.dep_sqmb = company.ObjeId;
                    }
                    else
                    {
                        throw new Exception("请选择申请部门!");
                    }

                    view.txt_lxdh     = model.ConstructionUnitPeople;
                    view.txt_sgdw     = model.WorkUnit;
                    view.txt_sgdwlxdh = model.WorkUnitPeople;
                    view.txt_jldw     = model.SupervisionUnit;
                    view.txt_jldwlxf  = model.SupervisionUnitPeople;
                    view.txt_sjdw     = model.DesignUnit;
                    view.txt_sjdwlxdh = model.DesignUnitPeople;
                    view.txt_bgdyy    = model.ChangeCause;
                    view.txt_bgdnr    = model.ChangeContent;
                    view.txt_gcljgc   = model.ProjectChange;
                    view.txt_bgdgq    = model.Impact;

                    if (model.HeaderID != null)
                    {
                        var baseUserHeaderID = DataOperateBasic <Base_User> .Get().GetModel(model.HeaderID.Value);

                        if (baseUserHeaderID == null)
                        {
                            throw new Exception("未找到部门负责人相关信息!");
                        }
                        view.hr_bmfzr = baseUserHeaderID.ObjeId;
                    }
                    if (model.LeaderID != null)
                    {
                        var baseUserLeaderID = DataOperateBasic <Base_User> .Get().GetModel(model.LeaderID.Value);

                        if (baseUserLeaderID == null)
                        {
                            throw new Exception("未找到分管领导相关信息!");
                        }
                        view.hr_fgld = baseUserLeaderID.ObjeId;
                    }
                    //附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    switch (item.TypeNo)
                        //    {
                        //        case "JSSQBG":
                        //            view.fj = fileUrl + '|' + view.fj; ;
                        //            break;
                        //        default:
                        //            break;
                        //    }
                        //}
                        //if (view.fj != null)
                        //{
                        //    view.fj = view.fj.Substring(view.fj.Length - 1);
                        //}
                        view.fj = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateTzChangeApplyWorkFlow(view);
                }
                #endregion

                //上传附件
                if (model.TzAttachs != null && model.TzAttachs.Any())
                {
                    AddFilesBytzTable(model, model.TzAttachs);
                }
                SetCreateUser(model);
                SetCurrentUser(model);
                model.ApprovalNameId = model.CreateUserId;
                model.ApprovalName   = model.CreateUserName;
                var rows = DataOperateBusiness <Epm_TzDesiginChangeApply> .Get().Add(model);

                result.Data = rows;
                result.Flag = EResultFlag.Success;
                //WriteLog(AdminModule.TzDesiginChangeApply.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddTzDesiginChangeApply");
            }
            return(result);
        }
コード例 #6
0
        ///<summary>
        ///修改:
        ///</summary>
        /// <param name="model">要修改的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> UpdateMeetingFileReport(Epm_MeetingFileReport model)
        {
            Result <int> result = new Result <int>();

            try
            {
                #region   会材料上报流程申请     暂时注释  勿删!!!
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    TzMeetingFileReportWorkFlowView view = new TzMeetingFileReportWorkFlowView();
                    var project = DataOperateBusiness <Epm_TzProjectProposal> .Get().GetModel(model.ProjectId);

                    view.ProjectName   = project.ProjectName;
                    view.StationName   = project.StationName;
                    view.NatureName    = project.NatureName;
                    view.Position      = project.Position;
                    view.ApplyTime     = project.ApplyTime.ToString();
                    view.CompanyName   = project.CompanyName;
                    view.PredictMoney  = project.ProjectCode;
                    view.OilSalesTotal = project.OilSalesTotal.ToString();
                    view.CNGY          = model.CNG.ToString();
                    view.LNGQ          = model.LNG.ToString();
                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    view.hr_sqr = baseUser.ObjeId;
                    //上传附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    //string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    //view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //    string fileUrl = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //}

                        //if (view.Temp_TzAttachs != null)
                        //{
                        //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                        //}
                        view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateMeetingFileReportWorkFlow(view);
                }
                #endregion

                var rows = DataOperateBusiness <Epm_MeetingFileReport> .Get().Update(model);

                result.Data = rows;
                result.Flag = EResultFlag.Success;
                //WriteLog(AdminModule.MeetingFileReport.GetText(), SystemRight.Modify.GetText(), "修改: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "UpdateMeetingFileReport");
            }
            return(result);
        }
コード例 #7
0
        ///<summary>
        ///添加:项目评审记录
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddTzProjectReveiews(Epm_TzProjectReveiews model)
        {
            Result <int> result = new Result <int>();

            try
            {
                int  rows     = 0;
                bool isAdd    = false;
                var  reveiews = DataOperateBusiness <Epm_TzProjectReveiews> .Get().GetList(t => t.ProjectId == model.ProjectId && t.State != (int)PreProjectState.ApprovalFailure && t.State != (int)PreProjectState.Discarded).FirstOrDefault();

                if (reveiews == null)
                {
                    isAdd    = true;
                    reveiews = new Epm_TzProjectReveiews();
                    SetCreateUser(reveiews);
                }
                reveiews.ProjectId      = model.ProjectId;
                reveiews.ReveiewDate    = model.ReveiewDate;
                reveiews.HostUser       = model.HostUser;
                reveiews.Address        = model.Address;
                reveiews.ConclusionCode = model.ConclusionCode;
                reveiews.ConclusionName = model.ConclusionName;
                reveiews.OtherInfo      = model.OtherInfo;
                reveiews.InvitedExperts = model.InvitedExperts;
                reveiews.Attendees      = model.Attendees;
                reveiews.PerfectContent = model.PerfectContent;
                reveiews.State          = model.State;

                SetCurrentUser(reveiews);
                //上传附件
                AddFilesBytzTable(reveiews, model.TzAttachs);

                var projects = DataOperateBusiness <Epm_TzProjectProposal> .Get().GetModel(model.ProjectId);

                //特许经营项目性质的项目审批到项目批复完成就结束了,不生成工程模块的内容,不用写到机器人表里
                if (projects.Nature != "XMXZTXJY")
                {
                    #region  项目评审记录流程申请     暂时注释  勿删!!!
                    var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                    if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                    {
                        TzProjectReveiewsWorkFlowView view = new TzProjectReveiewsWorkFlowView();

                        var subjects = DataOperateBasic <Base_TypeDictionary> .Get().GetList(t => t.Type == DictionaryType.OtherInfo.ToString()).ToList();

                        string str = "";
                        foreach (var item in subjects)
                        {
                            if (subjects.Where(t => model.OtherInfo.Contains(t.No)).Any())
                            {
                                str = str + item.Name + ",";
                            }
                        }
                        str = str.Substring(0, str.Length - 1);
                        view.ProjectName    = projects.ProjectName;
                        view.StationName    = projects.StationName;
                        view.NatureName     = projects.NatureName;
                        view.Position       = projects.Position;
                        view.ApplyTime      = projects.ApplyTime.ToString();
                        view.CompanyName    = projects.CompanyName;
                        view.PredictMoney   = projects.PredictMoney.ToString();
                        view.ReveiewDate    = model.ReveiewDate.ToString();
                        view.HostUser       = model.HostUser;
                        view.Attendees      = model.Attendees;
                        view.ConclusionName = model.ConclusionName;
                        view.OtherInfo      = str;
                        view.Address        = model.Address;
                        view.PerfectContent = model.PerfectContent;
                        view.InvitedExperts = model.InvitedExperts;
                        var baseUser = DataOperateBasic <Base_User> .Get().GetModel(reveiews.CreateUserId);

                        if (baseUser == null)
                        {
                            throw new Exception("未找到申请人相关信息!");
                        }

                        view.hr_sqr = baseUser.ObjeId;

                        //上传附件
                        if (model.TzAttachs != null && model.TzAttachs.Any())
                        {
                            //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                            //foreach (var item in model.TzAttachs)
                            //{
                            //    string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                            //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                            //}

                            //if (view.Temp_TzAttachs != null)
                            //{
                            //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                            //}
                            view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                        }

                        reveiews.WorkFlowId = XtWorkFlowService.CreateProjectReveiewsWorkFlow(view);
                    }
                    #endregion
                }

                if (isAdd)
                {
                    rows = DataOperateBusiness <Epm_TzProjectReveiews> .Get().Add(reveiews);
                }
                else
                {
                    rows = DataOperateBusiness <Epm_TzProjectReveiews> .Get().Update(reveiews);
                }


                result.Data = rows;
                result.Flag = EResultFlag.Success;
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddTzProjectReveiews");
            }
            return(result);
        }
コード例 #8
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddTzDesignScheme(Epm_TzDesignScheme model)
        {
            Result <int> result = new Result <int>();

            try
            {
                int  rows  = 0;
                bool isAdd = false;
                //根据批复信息自动生成一条方案信息,如果已经存在==修改
                var reveiews = DataOperateBusiness <Epm_TzDesignScheme> .Get().GetList(t => t.ProjectId == model.ProjectId && t.State != (int)PreProjectApprovalState.ApprovalFailure && t.State != (int)PreProjectApprovalState.Closed).FirstOrDefault();

                #region receiews
                if (reveiews == null)//没有-新增
                {
                    isAdd    = true;
                    reveiews = new Epm_TzDesignScheme();
                    SetCreateUser(reveiews);
                }
                ///所属项目ID
                reveiews.ProjectId = model.ProjectId;
                ///项目编码
                reveiews.ProjectCode = model.ProjectCode;
                ///项目名称
                reveiews.ProjectName = model.ProjectName;
                ///项目批复号
                reveiews.ApprovalNo = model.ApprovalNo;
                ///项目性质(数据字典)
                reveiews.Nature = model.Nature;
                ///项目性质名称
                reveiews.NatureName = model.NatureName;
                ///项目提出日期(冗余)
                reveiews.ApplyTime = model.ApplyTime;
                //库站ID
                reveiews.StationId = model.StationId;
                ///库站协同编码
                reveiews.StationCodeXt = model.StationCodeXt;
                ///库站名称
                reveiews.StationName = model.StationName;
                ///地市公司ID
                reveiews.CompanyId = model.CompanyId;
                ///地市公司协同编码
                reveiews.CompanyCodeXt = model.CompanyCodeXt;
                ///地市公司名称
                reveiews.CompanyName = model.CompanyName;
                ///初步设计单位
                reveiews.DesignUnit = model.DesignUnit;
                ///示范/标注数据字典编码
                reveiews.StandarCode = model.StandarCode;
                ///示范名称
                reveiews.StandarName = model.StandarName;
                ///上报概算
                reveiews.Estimate = model.Estimate;
                ///总工程费用(冗余)
                reveiews.TotalInvestment = model.TotalInvestment;
                ///其它工程费用(冗余)
                reveiews.OtheInvestment = model.OtheInvestment;
                ///设计单位招标日期
                reveiews.InviteTime = model.InviteTime;
                ///设计单位负责人
                reveiews.DesignUnitCharge = model.DesignUnitCharge;
                //设计单位负责人职务
                reveiews.DesignJob = model.DesignJob;
                ///项目经理(冗余)
                reveiews.ProjectManager = model.ProjectManager;
                ///项目经理职务(冗余)
                reveiews.ProjectJob = model.ProjectJob;
                ///占地面积
                reveiews.LandArea = model.LandArea;
                ///加油机(台)
                reveiews.MachineofOilStage = model.MachineofOilStage;
                ///加气机(台)
                reveiews.MachineofGasStage = model.MachineofGasStage;
                ///储气机
                reveiews.GasWells = model.GasWells;
                ///油罐
                reveiews.OilTank = model.OilTank;
                ///罩棚面积(冗余)
                reveiews.Shelter = model.Shelter;
                ///站房面积(冗余)
                reveiews.StationRoom = model.StationRoom;
                ///便利店面积--暂时没有
                reveiews.ConvenienceRoom = model.ConvenienceRoom;
                ///批复概算投资(冗余)
                reveiews.ReleaseInvestmentAmount = model.ReleaseInvestmentAmount;
                ///其他工程内容
                reveiews.OtherProject = model.OtherProject;
                ///项目信息是否同步:是、否
                reveiews.IsSynchro = model.IsSynchro;
                ///状态:暂存、待审核、审批通过、不通过
                reveiews.State = model.State;
                ///工程费用
                reveiews.EngineeringCost = model.EngineeringCost;
                ///其它费用
                reveiews.OtherExpenses = model.OtherExpenses;
                ///土地费用
                reveiews.LandCosts = model.LandCosts;
                ///估算投资
                reveiews.PredictMoney = model.PredictMoney;
                ///地区公司
                reveiews.RegionCompany = model.RegionCompany;
                //项目类型
                reveiews.ProjectType = model.ProjectType;
                #endregion

                SetCurrentUser(reveiews);
                #region  设计方案流程申请     暂时注释  勿删!!!
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    TzDesignSchemeWorkFlowView view = new TzDesignSchemeWorkFlowView();

                    view.ApprovalNo              = model.ApprovalNo;
                    view.CompanyName             = model.CompanyName;
                    view.ConvenienceRoom         = model.ConvenienceRoom.ToString();
                    view.DesignJob               = model.DesignJob;
                    view.DesignUnit              = model.DesignUnit;
                    view.DesignUnitCharge        = model.DesignUnitCharge;
                    view.Estimate                = model.Estimate.ToString();
                    view.GasWells                = model.GasWells.ToString();
                    view.InviteTime              = string.Format("{0:yyyy-MM-dd}", model.InviteTime);
                    view.IsSynchro               = model.IsSynchro;
                    view.LandArea                = model.LandArea.ToString();
                    view.MachineofGasStage       = model.MachineofGasStage.ToString();
                    view.MachineofOilStage       = model.MachineofOilStage.ToString();
                    view.NatureName              = model.NatureName;
                    view.OilTank                 = model.OilTank.ToString();
                    view.OtheInvestment          = model.OtheInvestment.ToString();
                    view.OtherProject            = model.OtherProject;
                    view.PredictMoney            = model.PredictMoney.ToString();
                    view.ProjectCode             = model.ProjectCode;
                    view.ProjectJob              = model.ProjectJob;
                    view.ProjectManager          = model.ProjectManager;
                    view.ProjectName             = model.ProjectName;
                    view.ProvinceName            = model.RegionCompany;
                    view.ReleaseInvestmentAmount = model.ReleaseInvestmentAmount.ToString();
                    view.Shelter                 = model.Shelter.ToString();
                    view.StandarName             = model.StandarName;
                    view.StationName             = model.StationName;
                    view.StationRoom             = model.StationRoom.ToString();
                    view.StationTypeName         = model.ProjectType;
                    view.TotalInvestment         = model.TotalInvestment.ToString();
                    view.LandCosts               = model.LandCosts.ToString();
                    view.EngineeringCost         = model.EngineeringCost.ToString();
                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(reveiews.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    view.hr_sqr = baseUser.ObjeId;
                    //上传附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //}
                        //if (view.Temp_TzAttachs != null)
                        //{
                        //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                        //}
                        view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    reveiews.WorkFlowId = XtWorkFlowService.CreateDesignSchemeWorkFlow(view);
                }
                #endregion
                if (isAdd)
                {
                    rows = DataOperateBusiness <Epm_TzDesignScheme> .Get().Add(reveiews);
                }
                else
                {
                    rows = DataOperateBusiness <Epm_TzDesignScheme> .Get().Update(reveiews);
                }

                //上传附件
                AddFilesBytzTable(reveiews, model.TzAttachs);



                result.Data = rows;
                result.Flag = EResultFlag.Success;
                // WriteLog(AdminModule.TzDesignScheme.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddTzDesignScheme");
            }
            return(result);
        }
コード例 #9
0
        ///<summary>
        ///修改:
        ///</summary>
        /// <param name="model">要修改的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> UpdateTzDesignScheme(Epm_TzDesignScheme model)
        {
            Result <int> result = new Result <int>();

            try
            {
                var scheme = DataOperateBusiness <Epm_TzDesignScheme> .Get().Single(p => p.ProjectId == model.ProjectId);

                if (scheme == null)
                {
                    throw new Exception("修改的数据不存在或者已被删除!");
                }
                //生成设计方案信息
                //scheme.ProjectId = model.ProjectId;
                //scheme.ProjectCode = model.ProjectCode;
                //scheme.ProjectName = model.ProjectName;
                //scheme.ApprovalNo = model.ApprovalNo;
                //scheme.Nature = model.Nature;
                //scheme.NatureName = model.NatureName;
                //scheme.ApplyTime = model.ApplyTime;
                //scheme.StationId = model.StationId;
                //scheme.StationCodeXt = model.StationCodeXt;
                //scheme.StationName = model.StationName;
                //scheme.CompanyId = model.CompanyId;
                //scheme.CompanyCodeXt = model.CompanyCodeXt;
                //scheme.CompanyName = model.CompanyName;
                //scheme.PredictMoney = model.PredictMoney;

                //scheme.DesignUnit = model.DesignUnit;
                //scheme.StandarCode = model.StandarCode;
                //scheme.StandarName = model.StandarName;
                //scheme.Estimate = model.Estimate;
                //scheme.TotalInvestment = model.TotalInvestment;
                //scheme.OtheInvestment = model.OtheInvestment;
                //scheme.InviteTime = model.InviteTime;
                //scheme.DesignUnitCharge = model.DesignUnitCharge;
                //scheme.DesignJob = model.DesignJob;
                //scheme.ProjectManager = model.ProjectManager;
                //scheme.ProjectJob = model.ProjectJob;

                //scheme.ConvenienceRoom = model.ConvenienceRoom;
                //scheme.ReleaseInvestmentAmount = model.ReleaseInvestmentAmount;
                //scheme.OtherProject = model.OtherProject;
                //scheme.IsSynchro = model.IsSynchro;


                //scheme.EngineeringCost = model.EngineeringCost;
                //scheme.OtherExpenses = model.OtherExpenses;
                //scheme.LandCosts = model.LandCosts;
                //scheme.RegionCompany = model.RegionCompany;
                //scheme.ProjectType = model.ProjectType;

                //scheme.LandArea = model.LandArea;//占地面积
                //scheme.MachineofOilStage = model.MachineofOilStage;//加油机
                //scheme.MachineofGasStage = model.MachineofGasStage;//加气机
                //scheme.GasWells = model.GasWells;//储气井
                //scheme.OilTank = model.OilTank;//油罐
                //scheme.Shelter = model.Shelter;//罩棚面积
                //scheme.StationRoom = model.StationRoom;//站房面积
                //scheme.TotalInvestment = model.TotalInvestment;//批复概算投资
                //scheme.ApprovalNo = model.ApprovalNo;//批复文号

                SetCurrentUser(model);

                //上传附件
                AddFilesBytzTable(model, model.TzAttachs);

                #region  设计方案流程申请   暂时注释  勿删!!!
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    TzDesignSchemeWorkFlowView view = new TzDesignSchemeWorkFlowView();

                    view.ApprovalNo              = model.ApprovalNo;
                    view.CompanyName             = model.CompanyName;
                    view.ConvenienceRoom         = model.ConvenienceRoom.ToString();
                    view.DesignJob               = model.DesignJob;
                    view.DesignUnit              = model.DesignUnit;
                    view.DesignUnitCharge        = model.DesignUnitCharge;
                    view.Estimate                = model.Estimate.ToString();
                    view.GasWells                = model.GasWells.ToString();
                    view.InviteTime              = string.Format("{0:yyyy-MM-dd}", model.InviteTime);
                    view.IsSynchro               = model.IsSynchro;
                    view.LandArea                = model.LandArea.ToString();
                    view.MachineofGasStage       = model.MachineofGasStage.ToString();
                    view.MachineofOilStage       = model.MachineofOilStage.ToString();
                    view.NatureName              = model.NatureName;
                    view.OilTank                 = model.OilTank.ToString();
                    view.OtheInvestment          = model.OtheInvestment.ToString();
                    view.OtherProject            = model.OtherProject;
                    view.PredictMoney            = model.PredictMoney.ToString();
                    view.ProjectCode             = model.ProjectCode;
                    view.ProjectJob              = model.ProjectJob;
                    view.ProjectManager          = model.ProjectManager;
                    view.ProjectName             = model.ProjectName;
                    view.ProvinceName            = model.RegionCompany;
                    view.ReleaseInvestmentAmount = model.ReleaseInvestmentAmount.ToString();
                    view.Shelter                 = model.Shelter.ToString();
                    view.StandarName             = model.StandarName;
                    view.StationName             = model.StationName;
                    view.StationRoom             = model.StationRoom.ToString();
                    view.StationTypeName         = model.ProjectType;
                    view.TotalInvestment         = model.TotalInvestment.ToString();
                    view.LandCosts               = model.LandCosts.ToString();
                    view.EngineeringCost         = model.EngineeringCost.ToString();
                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    view.hr_sqr = baseUser.ObjeId;
                    //上传附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    //string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    //view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //    string fileUrl = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //}
                        //if (view.Temp_TzAttachs != null)
                        //{
                        //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                        //}
                        view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateDesignSchemeWorkFlow(view);
                }
                #endregion
                var rows = DataOperateBusiness <Epm_TzDesignScheme> .Get().Update(model);

                result.Data = rows;
                result.Flag = EResultFlag.Success;
                // WriteLog(AdminModule.TzDesignScheme.GetText(), SystemRight.Modify.GetText(), "修改: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "UpdateTzDesignScheme");
            }
            return(result);
        }
コード例 #10
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddTzConDrawing(Epm_TzConDrawing model, List <Base_Files> baseEntity)
        {
            Result <int> result = new Result <int>();

            try
            {
                int  rows     = 0;
                bool isAdd    = false;
                var  reveiews = DataOperateBusiness <Epm_TzConDrawing> .Get().GetList(t => t.ProjectId == model.ProjectId).FirstOrDefault();

                var ApprovalInfo = DataOperateBusiness <Epm_TzProjectApprovalInfo> .Get().GetList(t => t.ProjectId == model.ProjectId).FirstOrDefault();

                if (reveiews == null)
                {
                    isAdd    = true;
                    reveiews = new Epm_TzConDrawing();
                    //当前创建人
                    SetCreateUser(reveiews);
                }
                reveiews.ProjectId     = model.ProjectId;           //项目id
                reveiews.ProjectCode   = model.ProjectCode;         //项目编码
                reveiews.ProjectName   = model.ProjectName;         //项目名称
                reveiews.ApprovalNo    = model.ApprovalNo;          //批复号
                reveiews.Nature        = model.Nature;              //项目性质
                reveiews.NatureName    = model.NatureName;          //项目性质名称
                reveiews.ApplyTime     = model.ApplyTime;           //项目提出日期
                reveiews.StationId     = model.StationId;           //站库id
                reveiews.StationCodeXt = model.StationCodeXt;       //站库协同编码
                reveiews.StationName   = model.StationName;         //站库名称
                reveiews.CompanyId     = model.CompanyId;           //地市公司id
                reveiews.CompanyCodeXt = model.CompanyCodeXt;       //地市公司协同编码
                reveiews.CompanyName   = model.CompanyName;         //地市公司名称
                reveiews.ReviewTime    = model.ReviewTime;          //评审日期
                reveiews.Moderator     = model.Moderator;           //主持人
                reveiews.ReviewAddress = model.ReviewAddress;       //评审地点
                reveiews.ReviewExperts = model.ReviewExperts;       //评审专家
                reveiews.Participants  = model.Participants;        //参会人员
                reveiews.Conclusion    = model.Conclusion;          //评审结论

                reveiews.State            = model.State;            //状态
                reveiews.Remark           = model.Remark;           //备注
                reveiews.DrawingId        = model.DrawingId;        //图纸id
                reveiews.ProjectDrawingID = model.ProjectDrawingID; //施工项目id

                //当前操作人
                SetCurrentUser(reveiews);
                //上传附件
                AddFilesBytzTable(reveiews, model.TzAttachs);
                #region  施工图纸会审流程申请     暂时注释  勿删!!!
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    TzConDrawingWorkFlowView view = new TzConDrawingWorkFlowView();

                    view.CompanyName     = model.CompanyName;
                    view.Conclusion      = model.CompanyName;
                    view.Moderator       = model.Moderator;
                    view.NatureName      = model.NatureName;
                    view.Participants    = model.Participants;
                    view.PredictMoney    = "";
                    view.ProjectCode     = model.ProjectCode;
                    view.ProjectName     = model.ProjectName;
                    view.ProvinceName    = model.CompanyName;
                    view.ReviewAddress   = model.ReviewAddress;
                    view.ReviewExperts   = model.ReviewExperts;
                    view.ReviewTime      = model.ReviewTime.ToString();
                    view.StationName     = model.StationName;
                    view.StationTypeName = model.Nature;
                    view.LandCosts       = ApprovalInfo.LandCosts.ToString();
                    view.OtherExpenses   = ApprovalInfo.OtherExpenses.ToString();
                    view.EngineeringCost = ApprovalInfo.EngineeringCost.ToString();
                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(reveiews.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }

                    view.hr_sqr = baseUser.ObjeId;
                    //上传附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    //string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    //view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //    string fileUrl = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //}
                        //if (view.Temp_TzAttachs != null)
                        //{
                        //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                        //}
                        view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    reveiews.WorkFlowId = XtWorkFlowService.CreateConDrawingWorkFlow(view);
                }
                #endregion
                if (isAdd)
                {
                    rows = DataOperateBusiness <Epm_TzConDrawing> .Get().Add(reveiews);
                }
                else
                {
                    rows = DataOperateBusiness <Epm_TzConDrawing> .Get().Update(reveiews);
                }


                if (baseEntity.Count != 0 && model.State == (int)PreProjectApprovalState.ApprovalSuccess) //如果附件选择了图纸类型&&状态是通过了审核,往图纸管理同步一条数据
                {
                    baseEntity = baseEntity.Where(p => p.ImageType == "SGTZSHTZ").ToList();               //筛选附件是图纸类型(SGTZSHTZ)
                    drawingToDraw(reveiews, baseEntity);                                                  //整理图纸管理数据
                }



                result.Data = rows;
                result.Flag = EResultFlag.Success;
                // WriteLog(AdminModule.TzConDrawing.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddTzConDrawing");
            }
            return(result);
        }
コード例 #11
0
        ///<summary>
        ///修改:
        ///</summary>
        /// <param name="model">要修改的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> UpdateTzConDrawing(Epm_TzConDrawing model, List <Base_Files> baseEntity)
        {
            Result <int> result = new Result <int>();

            try
            {
                var drawing = DataOperateBusiness <Epm_TzConDrawing> .Get().Single(p => p.Id == model.Id);

                model.ProjectId     = drawing.ProjectId;     //项目ID
                model.ProjectCode   = drawing.ProjectCode;   //项目编码
                model.ProjectName   = drawing.ProjectName;   //项目名称
                model.ApprovalNo    = drawing.ApprovalNo;    //项目批复号
                model.Nature        = drawing.Nature;        //项目性质
                model.NatureName    = drawing.NatureName;    //项目性质名称
                model.ApplyTime     = drawing.ApplyTime;     //项目提出时间
                model.StationId     = drawing.StationId;     //站库id
                model.StationCodeXt = drawing.StationCodeXt; //站库协同编码
                model.StationName   = drawing.StationName;   //站库名称
                model.CompanyId     = drawing.CompanyId;     //地市公司ID
                model.CompanyCodeXt = drawing.CompanyCodeXt; //地市公司编码
                model.CompanyName   = drawing.CompanyName;   //地市公司名称

                SetCurrentUser(model);
                //上传图纸
                AddFilesBytzTable(model, model.TzAttachs);
                #region  施工图纸会审流程申请     暂时注释  勿删!!!
                var XtWorkFlow = System.Configuration.ConfigurationManager.AppSettings.Get("XtWorkFlow");
                if (model.State == (int)PreProjectState.WaitApproval && XtWorkFlow == "1")
                {
                    TzConDrawingWorkFlowView view = new TzConDrawingWorkFlowView();
                    var baseUser = DataOperateBasic <Base_User> .Get().GetModel(model.CreateUserId);

                    if (baseUser == null)
                    {
                        throw new Exception("未找到申请人相关信息!");
                    }
                    else
                    {
                        view.hr_sqr = baseUser.ObjeId;
                    }
                    view.CompanyName     = model.CompanyName;
                    view.Conclusion      = model.CompanyName;
                    view.Moderator       = model.Moderator;
                    view.NatureName      = model.NatureName;
                    view.Participants    = model.Participants;
                    view.PredictMoney    = "";
                    view.ProjectCode     = model.ProjectCode;
                    view.ProjectName     = model.ProjectName;
                    view.ProvinceName    = model.CompanyName;
                    view.ReviewAddress   = model.ReviewAddress;
                    view.ReviewExperts   = model.ReviewExperts;
                    view.ReviewTime      = model.ReviewTime.ToString();
                    view.StationName     = model.StationName;
                    view.StationTypeName = model.Nature;

                    //上传附件
                    if (model.TzAttachs != null && model.TzAttachs.Any())
                    {
                        //string baseFaleUrl = System.Configuration.ConfigurationManager.AppSettings.Get("XtDownloadUrl");
                        //foreach (var item in model.TzAttachs)
                        //{
                        //    //string fileUrl = string.Format("{0}?fileId={1}&type={2}", baseFaleUrl, item.Id, item.TypeNo);
                        //    //view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //    string fileUrl = XtWorkFlowService.GetXtAttachPaht(item.FilePath);
                        //    view.Temp_TzAttachs = fileUrl + '|' + view.Temp_TzAttachs;
                        //}
                        //if (view.Temp_TzAttachs != null)
                        //{
                        //    view.Temp_TzAttachs = view.Temp_TzAttachs.Substring(0, view.Temp_TzAttachs.Length - 1);
                        //}
                        view.Temp_TzAttachs = XtWorkFlowSubmitService.CreateXtAttachPath(model.TzAttachs);
                    }

                    model.WorkFlowId = XtWorkFlowService.CreateConDrawingWorkFlow(view);
                }
                #endregion

                var rows = DataOperateBusiness <Epm_TzConDrawing> .Get().Update(model);

                //AddFilesBytzTable(reveiews, model.TzAttachs);

                //if (model.TzAttachs != null)
                //{
                //    //删除之前的附件
                //    DeleteFilesByTable(model.GetType().Name, new List<long>() { model.Id });
                //    //新增附件
                //    AddFilesBytzTable(model, model.TzAttachs);
                //}
                //else
                //{
                //    //删除之前的附件
                //    DeleteFilesByTable(model.GetType().Name, new List<long>() { model.Id });
                //}

                if (baseEntity.Count != 0 && model.State == (int)PreProjectApprovalState.ApprovalSuccess)//如果附件选择了图纸类型&&状态是通过了审核,往图纸管理同步一条数据
                {
                    baseEntity = baseEntity.Where(p => p.ImageType == "SGTZSHTZ").ToList();
                    drawingToDraw(model, baseEntity);
                }

                result.Data = rows;
                result.Flag = EResultFlag.Success;
                // WriteLog(AdminModule.TzConDrawing.GetText(), SystemRight.Modify.GetText(), "修改: " + model.Id);
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "UpdateTzConDrawing");
            }
            return(result);
        }