public ActionResult Add(Epm_TzProjectStartApply model)
        {
            Result <int> result = new Result <int>();

            string fileDataJson = Request.Form["fileDataJsonFile"];//获取上传文件json字符串

            if (!string.IsNullOrEmpty(fileDataJson))
            {
                model.TzAttachs = JsonConvert.DeserializeObject <List <Epm_TzAttachs> >(fileDataJson);//将文件信息json字符
            }

            using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request)))
            {
                result = proxy.AddTzProjectStartApply(model);
            }
            return(Json(result.ToResultView()));
        }
 public TzStartTenderingAndSupplyView()
 {
     TzProjectStartApply = new Epm_TzProjectStartApply();
     timeAndCrossings    = new Epm_TimeLimitAndProcedure();
 }
Beispiel #3
0
        /// <summary>
        /// 修改施工图纸会审状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public Result <int> UpdateTzConDrawingState(List <long> ids, string state)
        {
            Result <int> result = new Result <int>();

            try
            {
                foreach (var item in ids)
                {
                    var model = DataOperateBusiness <Epm_TzConDrawing> .Get().GetModel(item);

                    if (model != null)
                    {
                        //SetCurrentUser(model);
                        model.State = (int)state.ToEnumReq <PreProjectApprovalState>();
                        var rows = DataOperateBusiness <Epm_TzConDrawing> .Get().Update(model);

                        //如果状态是已经提交,生成数据
                        if (model.State == (int)PreProjectApprovalState.ApprovalSuccess)
                        {
                            #region 自动生成开工申请信息
                            //项目提出信息
                            var tzProjectProposal = DataOperateBusiness <Epm_TzProjectProposal> .Get().GetModel(model.ProjectId.Value);

                            Epm_TzProjectStartApply tzProjectStartApply = new Epm_TzProjectStartApply();

                            tzProjectStartApply.ProjectId  = model.ProjectId;                            //项目ID
                            tzProjectStartApply.State      = (int)PreProjectApprovalState.WaitSubmitted; //状态
                            tzProjectStartApply.ApplyTitle = model.ProjectName;;


                            //申请人
                            tzProjectStartApply.ApplyUserName = CurrentUser.UserAcct;
                            tzProjectStartApply.ApplyUserId   = CurrentUser.Id;
                            //申请单位
                            tzProjectStartApply.ApplyCompanyName = CurrentUser.CompanyName;
                            tzProjectStartApply.ApplyCompanyId   = CurrentUser.CompanyId;
                            //申请时间
                            tzProjectStartApply.StartApplyTime = DateTime.Now;


                            //标题
                            tzProjectStartApply.ApplyTitle = model.ProjectName + "项目开工申请" + CurrentUser.UserAcct + DateTime.Now.ToString("yyyy-MM-dd");

                            tzProjectStartApply.ProjectCode   = tzProjectProposal.ProjectCode;
                            tzProjectStartApply.ApprovalNo    = tzProjectProposal.ApprovalNo;
                            tzProjectStartApply.Nature        = tzProjectProposal.Nature;
                            tzProjectStartApply.NatureName    = tzProjectProposal.NatureName;
                            tzProjectStartApply.ApplyTime     = tzProjectProposal.ApplyTime;
                            tzProjectStartApply.StationId     = tzProjectProposal.StationId;
                            tzProjectStartApply.StationCodeXt = tzProjectProposal.StationCodeXt;
                            tzProjectStartApply.StationName   = tzProjectProposal.StationName;
                            tzProjectStartApply.CompanyId     = tzProjectProposal.CompanyId;
                            tzProjectStartApply.CompanyCodeXt = tzProjectProposal.CompanyCodeXt;
                            tzProjectStartApply.CompanyName   = tzProjectProposal.CompanyName;
                            tzProjectStartApply.ProjectName   = tzProjectProposal.ProjectName;

                            //AddTzProjectStartApply(tzProjectStartApply);
                            SetCreateUser(tzProjectStartApply);
                            SetCurrentUser(tzProjectStartApply);
                            DataOperateBusiness <Epm_TzProjectStartApply> .Get().Add(tzProjectStartApply);

                            #endregion

                            #region 自动生成RPA数据
                            string           houstAddress = System.Configuration.ConfigurationManager.AppSettings.Get("RPAPath");
                            RPA_TzConDrawing RPAModel     = new RPA_TzConDrawing();

                            RPAModel.ProjectTypeName = model.NatureName;//项目类型
                            RPAModel.ReviewTime      = model.ReviewTime;
                            RPAModel.ReviewAddress   = model.ReviewAddress;
                            RPAModel.Moderator       = model.Moderator;
                            RPAModel.ReviewExperts   = model.ReviewExperts;
                            RPAModel.Participants    = model.Participants;
                            RPAModel.Conclusion      = model.Conclusion;
                            RPAModel.Conclusion      = model.Conclusion == "XMPSJL1" ? "同意" : model.Conclusion == "XMPSJL2" ? "原则同意" : model.Conclusion == "XMPSJL3" ? "不同意" : "";
                            RPAModel.Remark          = model.Remark;
                            RPAModel.username        = "******";
                            RPAModel.companys        = CurrentUser.CompanyName;
                            RPAModel.WriteMark       = 0;
                            RPAModel.WriteResult     = 0;
                            RPAModel.FollowOperate   = "";

                            var fileList = GetFilesByTZTable("Epm_TzConDrawing", model.Id).Data;
                            for (int i = 0; i < fileList.Count; i++)
                            {
                                RPAModel.FilePath += houstAddress + "?path=" + fileList[i].FilePath + "&fileName=" + fileList[i].Name + ",";
                            }
                            RPAModel.FileNumber = fileList.Count;

                            SetCreateUser(RPAModel);
                            SetCurrentUser(RPAModel);
                            DataOperateBusiness <RPA_TzConDrawing> .Get().Add(RPAModel);

                            #endregion
                            #region 自动生成OMADS数据
                            OMADS_TzConDrawing oMADSModel = new OMADS_TzConDrawing();

                            oMADSModel.ProjectTypeName = model.NatureName;//项目类型
                            oMADSModel.ReviewTime      = model.ReviewTime;
                            oMADSModel.ReviewAddress   = model.ReviewAddress;
                            oMADSModel.Moderator       = model.Moderator;
                            oMADSModel.ReviewExperts   = model.ReviewExperts;
                            oMADSModel.Participants    = model.Participants;
                            oMADSModel.Conclusion      = model.Conclusion == "XMPSJL1" ? "同意" : model.Conclusion == "XMPSJL2" ? "原则同意" : model.Conclusion == "XMPSJL3" ? "不同意" : "";
                            oMADSModel.Remark          = model.Remark;
                            oMADSModel.username        = CurrentUser.UserAcct;
                            oMADSModel.companys        = CurrentUser.CompanyName;
                            oMADSModel.WriteMark       = 0;
                            oMADSModel.WriteResult     = 0;
                            oMADSModel.FollowOperate   = "";

                            var ofileList = GetFilesByTZTable("Epm_TzConDrawing", model.Id).Data;
                            for (int i = 0; i < ofileList.Count; i++)
                            {
                                oMADSModel.FilePath += houstAddress + "?path=" + ofileList[i].FilePath + "&fileName=" + fileList[i].Name + ",";
                            }
                            oMADSModel.FileNumber = ofileList.Count;

                            SetCreateUser(oMADSModel);
                            SetCurrentUser(oMADSModel);
                            DataOperateBusiness <OMADS_TzConDrawing> .Get().Add(oMADSModel);

                            #endregion
                            #region 自动生成TEMP数据
                            TEMP_TzConDrawing tEMPModel = new TEMP_TzConDrawing();

                            tEMPModel.ProjectTypeName = model.NatureName;//项目类型
                            tEMPModel.ReviewTime      = model.ReviewTime;
                            tEMPModel.ReviewAddress   = model.ReviewAddress;
                            tEMPModel.Moderator       = model.Moderator;
                            tEMPModel.ReviewExperts   = model.ReviewExperts;
                            tEMPModel.Participants    = model.Participants;
                            tEMPModel.Conclusion      = model.Conclusion == "XMPSJL1" ? "同意" : model.Conclusion == "XMPSJL2" ? "原则同意" : model.Conclusion == "XMPSJL3" ? "不同意" : "";
                            tEMPModel.Remark          = model.Remark;
                            tEMPModel.username        = CurrentUser.UserAcct;
                            tEMPModel.companys        = CurrentUser.CompanyName;
                            tEMPModel.WriteMark       = 0;
                            tEMPModel.WriteResult     = 0;
                            tEMPModel.FollowOperate   = "";

                            var tfileList = GetFilesByTZTable("Epm_TzConDrawing", model.Id).Data;
                            for (int i = 0; i < tfileList.Count; i++)
                            {
                                tEMPModel.FilePath += houstAddress + "?path=" + tfileList[i].FilePath + "&fileName=" + fileList[i].Name + ",";
                            }
                            tEMPModel.FileNumber = tfileList.Count;

                            SetCreateUser(tEMPModel);
                            SetCurrentUser(tEMPModel);
                            DataOperateBusiness <TEMP_TzConDrawing> .Get().Add(tEMPModel);

                            #endregion
                        }

                        result.Data = rows;
                        result.Flag = EResultFlag.Success;
                    }
                    else
                    {
                        throw new Exception("该施工图纸会审不存在");
                    }
                }
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "UpdateTzConDrawingState");
            }
            return(result);
        }