protected override void OnFlowEnd(S_EP_SubContractSettlement data, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (data != null)
     {
         data.Push();
     }
 }
 protected override void OnFlowEnd(S_EP_IncomeInvoiceConfirmRevert data, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (data != null)
     {
         data.Push();
     }
 }
예제 #3
0
        public JsonResult AddTaskExec(string taskID, string UserID, string userName)
        {
            //创建TaskExec
            S_WF_InsTaskExec taskExec = new S_WF_InsTaskExec();

            taskExec.ID           = FormulaHelper.CreateGuid();
            taskExec.InsTaskID    = taskID;
            taskExec.CreateTime   = DateTime.Now;
            taskExec.TaskUserID   = UserID;
            taskExec.TaskUserName = userName;

            //执行人
            taskExec.ExecUserID   = taskExec.TaskUserID;
            taskExec.ExecUserName = taskExec.TaskUserName;
            taskExec.Type         = TaskExecType.Normal.ToString();

            var entities = FormulaHelper.GetEntities <WorkflowEntities>();
            var task     = entities.Set <S_WF_InsTask>().Where(c => c.ID == taskID).SingleOrDefault();

            taskExec.InsFlowID = task.InsFlowID;
            entities.Set <S_WF_InsTaskExec>().Add(taskExec);
            entities.SaveChanges();

            return(Json(""));
        }
        protected override void OnFlowEnd(T_I_ManagerChange entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var updateSql = string.Empty;

            if (string.IsNullOrWhiteSpace(entity.LastVersionID))
            {
                var sql = string.Format(@"select * from T_I_ManagerNominate where ID='{0}' ", entity.ManagerNominateID);
                var dt  = EPCSQLDB.ExecuteDataTable(sql);
                if (dt.Rows.Count == 0)
                {
                    throw new Formula.Exceptions.BusinessValidationException("此项目的项目经理信息不存在,请确认!");
                }
                var firstChange = FormulaHelper.DataRowToDic(dt.Rows[0]);
                firstChange.SetValue("NewManager", firstChange.GetValue("Manager"));
                firstChange.SetValue("NewManagerName", firstChange.GetValue("ManagerName"));
                firstChange.SetValue("ManagerNominateID", firstChange.GetValue("ID"));
                firstChange.SetValue("LastVersionID", string.Empty);
                firstChange.SetValue("FirstOne", "true");
                updateSql += firstChange.CreateInsertSql(EPCSQLDB, "T_I_ManagerChange", FormulaHelper.CreateGuid());
            }
            var managerNominate = entity.ToDic();

            managerNominate.SetValue("FlowPhase", "End");
            managerNominate.SetValue("Manager", managerNominate.GetValue("NewManager"));
            managerNominate.SetValue("ManagerName", managerNominate.GetValue("NewManagerName"));
            updateSql += managerNominate.CreateUpdateSql(EPCSQLDB, "T_I_ManagerNominate", managerNominate.GetValue("ManagerNominateID"));
            EPCSQLDB.ExecuteNonQuery(updateSql);
        }
 protected override void OnFlowEnd(S_EP_ProductionBatchSettleApply data, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (data != null)
     {
         data.Push();
     }
 }
예제 #6
0
        private S_WF_InsTaskExec GetTaskExec(string taskExecID)
        {
            WorkflowEntities flowEntities = FormulaHelper.GetEntities <WorkflowEntities>();
            S_WF_InsTaskExec task         = flowEntities.S_WF_InsTaskExec.FirstOrDefault(p => p.ID == taskExecID);

            return(task);
        }
예제 #7
0
        public override bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            var auditStateArray = Enum.GetNames(typeof(Project.Logic.AuditState));
            var str             = "";

            for (int i = 0; i < auditStateArray.Length; i++)
            {
                if ((i + 1) % 5 != 0)
                {
                    str += auditStateArray[i] + "、";
                }
                else
                {
                    str += "<br/>" + auditStateArray[i] + "、";
                }
            }
            var workFlowEntities = FormulaHelper.GetEntities <WorkflowEntities>();
            var nextStep         = workFlowEntities.Set <S_WF_InsDefStep>().SingleOrDefault(c => c.ID == routing.EndID);

            if (!string.IsNullOrEmpty(nextStep.Code) && !auditStateArray.Contains(nextStep.Code))
            {
                throw new Formula.Exceptions.BusinessException("校审环节【" + nextStep.Code + "】不符合要求,流程未能启动<br/>"
                                                               + "环节编号只能是:" + str.TrimEnd('、'));
            }
            return(base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment));
        }
예제 #8
0
        protected override void OnFlowEnd(S_I_IdentifyApply entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var state   = IdentifyState.Identified.ToString();
            var infoIDs = entity.S_I_IdentifyApply_DetailInfo.Select(a => a.IdentifyInfoID).ToArray();

            this.BusinessEntities.Set <S_I_IdentifyInfo>().Where(a => infoIDs.Contains(a.ID)).Update(a => a.State = state);
            //添加鉴定记录
            var           IdentifyApplyDetails = entity.S_I_IdentifyApply_DetailInfo.Select(a => a).ToList();
            InventoryType type = new InventoryType();

            foreach (var IdentifyApplyDetail in IdentifyApplyDetails)
            {
                var        identifyInfo = this.BusinessEntities.Set <S_I_IdentifyInfo>().FirstOrDefault(b => b.ID.Equals(IdentifyApplyDetail.IdentifyInfoID));
                S_NodeInfo node         = new S_NodeInfo(identifyInfo.NodeID, FormulaHelper.GetEntities <DocConfigEntities>().S_DOC_Space.FirstOrDefault(b => b.ID.Equals(identifyInfo.SpaceID)));
                if (IdentifyApplyDetail.IdentifyResult.Equals(InventoryType.Destroy.ToString()))
                {
                    type = InventoryType.Destroy;
                }
                else
                {
                    type = InventoryType.ChangePeriod;
                }
                InventoryFO.CreateNewInventoryLedger(node, "鉴定结果为:" + EnumBaseHelper.GetEnumDescription(type.GetType(), type.ToString()), type);
            }
        }
예제 #9
0
        protected override void OnFlowEnd(S_P_ProcurementContractChange entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var contract = entity.Push();

            this.EPCEntites.SaveChanges();
            AfterSave(contract.ToDic());
        }
예제 #10
0
        protected override void OnFlowEnd(T_C_TenderingSubcontractor entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var tenderingID = entity.T_C_TenderingInfoID;

            if (!string.IsNullOrEmpty(tenderingID))
            {
                var tenderingInfo = this.EPCEntites.Set <T_C_TenderingInfo>().Where(x => x.ID == tenderingID).FirstOrDefault();
                if (tenderingInfo != null)
                {
                    tenderingInfo.BidAmount            = entity.BidAmount;
                    tenderingInfo.BidSubcontractor     = entity.BidSubcontractor;
                    tenderingInfo.BidSubcontractorName = entity.BidSubcontractorName;

                    this.EPCEntites.Set <S_P_Invitation_Winner>().Delete(x => x.InvitationID == tenderingID);
                    S_P_Invitation_Winner sw = new S_P_Invitation_Winner();
                    sw.ID           = FormulaHelper.CreateGuid();
                    sw.Winner       = entity.BidSubcontractor;
                    sw.WinnerName   = entity.BidSubcontractorName;
                    sw.WinPrice     = Convert.ToDecimal(entity.BidAmount);
                    sw.InvitationID = tenderingID;
                    this.EPCEntites.Set <S_P_Invitation_Winner>().Add(sw);

                    this.EPCEntites.SaveChanges();
                }
            }
        }
예제 #11
0
        public override bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing,
                                          string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup,
                                          string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            string tmplCode = Request["TmplCode"];
            var    formInfo = baseEntities.Set <S_UI_Form>().Where(c => c.Code == tmplCode).OrderByDescending(c => c.ID).FirstOrDefault(); //获取最新一个版本即可
            var    entity   = this.GetEntityByID <T>(taskExec.S_WF_InsFlow.FormInstanceID);
            bool   flag     = false;

            Workflow.Logic.BusinessFacade.FlowFO flowFO = new Workflow.Logic.BusinessFacade.FlowFO();
            flag = flowFO.ExecTask(taskExec.ID, routing.ID, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment, Request["RoutingID"]);
            //流程表单定义的流程逻辑
            ExecFlowLogic(routing.Code, taskExec.S_WF_InsFlow.FormInstanceID, "");
            SetFormFlowInfo(taskExec.S_WF_InsFlow);
            if (flag)
            {
                if (entity == null)
                {
                    throw new Formula.Exceptions.BusinessException("实体ID为空,未能找到相关实体对象,无法执行逻辑");
                }
                OnFlowEnd(entity, taskExec, routing);
            }
            this.BusinessEntities.SaveChanges();
            if (routing != null)
            {
                routing.ExeLogic();
                this.entities.SaveChanges();
            }
            return(flag);
        }
 protected override void OnFlowEnd(S_EP_SupplierContractConfirmRevert data, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (data != null)
     {
         data.Push();
     }
 }
예제 #13
0
 protected override void OnFlowEnd(S_EP_SupplierContractConfirm data, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     CheckSubContractConfirmMethod();
     if (data != null)
     {
         data.Push();
     }
 }
예제 #14
0
 protected override void OnFlowEnd(S_E_MajorPutInfo entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (entity != null)
     {
         entity.Push();
         this.EPCEntites.SaveChanges();
     }
 }
예제 #15
0
        public virtual bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            FlowFO flowFO = new FlowFO();

            //流程表单定义的流程逻辑
            ExecFlowLogic(routing.Code, taskExec.S_WF_InsFlow.FormInstanceID);

            return(flowFO.ExecTask(taskExec.ID, routing.ID, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment, Request["RoutingID"]));
        }
예제 #16
0
        protected override void OnFlowEnd(S_I_DestroyApply entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var state   = IdentifyState.Finish.ToString();
            var infoIDs = entity.S_I_DestroyApply_DetailInfo.Select(a => a.IdentifyInfoID).ToArray();
            var IdentifyApplyDetailInfoIDs = entity.S_I_DestroyApply_DetailInfo.Select(a => a.IdentifyApplyDetailInfoID).ToArray();

            this.BusinessEntities.Set <S_I_IdentifyApply_DetailInfo>().Where(a => IdentifyApplyDetailInfoIDs.Contains(a.ID)).Update(a => a.HandleResult = state);

            var apply = this.BusinessEntities.Set <S_I_IdentifyApply>().FirstOrDefault(a => a.ID == entity.IdentifyApplyID);

            if (apply != null)
            {
                if (apply.S_I_IdentifyApply_DetailInfo.Count(a => !IdentifyApplyDetailInfoIDs.Contains(a.ID) && a.HandleResult != state) == 0)
                {
                    apply.HandleState = HandleState.Finish.ToString();
                }
                else
                {
                    apply.HandleState = HandleState.Part.ToString();
                }
            }

            var updateDic = new Dictionary <S_DOC_Space, StringBuilder>();
            var infos     = this.BusinessEntities.Set <S_I_IdentifyInfo>().Where(a => infoIDs.Contains(a.ID)).ToList();

            foreach (var info in infos)
            {
                info.State = state;
                var space    = DocConfigHelper.CreateConfigSpaceByID(info.SpaceID);
                var nodeInfo = new S_NodeInfo(info.NodeID, space);

                if (!updateDic.ContainsKey(space))
                {
                    updateDic.Add(space, new StringBuilder());
                }

                updateDic[space].AppendLine(string.Format(@"
update S_NodeInfo set [State] = '{0}' where FullPathID like '{1}%' 
update S_FileInfo set [State] = '{0}' where FullNodeID like '{1}%'", DocState.Invalid.ToString(), nodeInfo.FullPathID));
            }

            foreach (var item in updateDic.Keys)
            {
                var instanceDB = SQLHelper.CreateSqlHelper(item.SpaceKey, item.ConnectString);
                instanceDB.ExecuteNonQuery(updateDic[item].ToString());
            }
            //添加销毁记录
            var IdentifyApplyDetails = this.BusinessEntities.Set <S_I_IdentifyApply_DetailInfo>().Where(a => IdentifyApplyDetailInfoIDs.Contains(a.ID)).Select(a => a).ToList();

            foreach (var IdentifyApplyDetail in IdentifyApplyDetails)
            {
                var        identifyInfo = this.BusinessEntities.Set <S_I_IdentifyInfo>().FirstOrDefault(b => b.ID.Equals(IdentifyApplyDetail.IdentifyInfoID));
                S_NodeInfo node         = new S_NodeInfo(identifyInfo.NodeID, FormulaHelper.GetEntities <DocConfigEntities>().S_DOC_Space.FirstOrDefault(b => b.ID.Equals(identifyInfo.SpaceID)));
                InventoryFO.CreateNewInventoryLedger(node, "", InventoryType.Destroy);
            }
        }
예제 #17
0
        public override void UnExecTaskExec(string taskExecID)
        {
            string           id           = GetQueryString("ID");
            WorkflowEntities flowEntities = FormulaHelper.GetEntities <WorkflowEntities>();
            S_WF_InsTaskExec taskExec     = flowEntities.Set <S_WF_InsTaskExec>().SingleOrDefault(c => c.ID == taskExecID);
            string           stepCode     = taskExec.S_WF_InsTask.S_WF_InsDefStep.Code;

            PostingFO.ChangeStatus(id, stepCode);
            base.UnExecTaskExec(taskExecID);
        }
 protected override void OnFlowEnd(T_BM_NoPaymentConfirmation entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     base.OnFlowEnd(entity, taskExec, routing);
     if (entity == null)
     {
         throw new Formula.Exceptions.BusinessException("获取当前未还款确认失败,请联系管理员!");
     }
     entity.Push();
     this.BusinessEntities.SaveChanges();
 }
예제 #19
0
 protected override void OnFlowEnd(S_C_RectifySheet entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     foreach (var item in entity.S_C_RectifySheet_RectifyProblems.ToList())
     {
         if (item.RectifyState == "Closed")
         {
             item.CloseDate = System.DateTime.Now.Date;
         }
     }
     this.EPCEntites.SaveChanges();
 }
예제 #20
0
        protected override void OnFlowEnd(T_M_ContractInfo entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var project = EPCEntites.Set <T_I_EngineeringBuild>().FirstOrDefault(c => c.ID == entity.ProjectInfo);

            if (project != null)
            {
                project.Programme            = entity.Programme;
                project.ConstructionFeatures = entity.ConstructionFeatures;
                project.ConstructionSite     = entity.ConstructionSite;
            }
            EPCEntites.SaveChanges();
        }
예제 #21
0
        public override bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            var entity = this.BusinessEntities.Set <S_I_IdentifyApply>().SingleOrDefault(c => c.ID == taskExec.S_WF_InsFlow.FormInstanceID);

            if (entity != null)
            {
                var state   = IdentifyState.InFlow.ToString();
                var infoIDs = entity.S_I_IdentifyApply_DetailInfo.Select(a => a.IdentifyInfoID).ToArray();
                this.BusinessEntities.Set <S_I_IdentifyInfo>().Where(a => infoIDs.Contains(a.ID)).Update(a => a.State = state);
                this.BusinessEntities.SaveChanges();
            }
            return(base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment));
        }
예제 #22
0
        protected override void OnFlowEnd(T_M_ContractInfoChange entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            base.OnFlowEnd(entity, taskExec, routing);
            var contract  = EPCEntites.Set <T_M_ContractInfo>().Find(entity.ContractInfoID);
            var scontract = EPCEntites.Set <S_M_ContractInfo>().FirstOrDefault(c => c.TContractInfoID == contract.ID);

            if (entity != null && contract != null)
            {
                var ps = typeof(T_M_ContractInfo).GetProperties();
                foreach (PropertyInfo item in ps)
                {
                    string name  = item.Name;
                    string type  = item.PropertyType.Name;
                    object value = item.GetValue(entity, null);
                    if (type != "ICollection`1" && name != "ContractInfoID" && name != "VersionNumber" && name != "ID" & value != null)
                    {
                        item.SetValue(contract, value, null);
                    }
                }
            }
            if (entity != null && scontract != null)
            {
                var ps = typeof(S_M_ContractInfo).GetProperties();
                foreach (PropertyInfo item in ps)
                {
                    string name  = item.Name;
                    string type  = item.PropertyType.Name;
                    object value = item.GetValue(entity, null);
                    if (type != "ICollection`1" && name != "ContractInfoID" && name != "VersionNumber" && name != "ID" & value != null)
                    {
                        item.SetValue(scontract, value, null);
                    }
                }
            }
            var project = EPCEntites.Set <T_I_EngineeringBuild>().FirstOrDefault(c => c.ID == entity.ProjectInfo);

            if (project != null)
            {
                project.Programme            = entity.Programme;
                project.ConstructionFeatures = entity.ConstructionFeatures;
                project.ConstructionSite     = entity.ConstructionSite;
            }



            this.EPCEntites.SaveChanges();
        }
 protected override void OnFlowEnd(T_E_BomFetchPlan entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (entity != null)
     {
         foreach (var item in entity.T_E_BomFetchPlan_BomDetail.ToList())
         {
             var pbom = this.EPCEntites.Set <S_P_Bom>().FirstOrDefault(c => c.ID == item.BomID);
             if (pbom == null)
             {
                 continue;
             }
             pbom.PlanFetchDate = item.PlanFetchDate;
             pbom.PlanPacthID   = entity.ID;
         }
         this.EPCEntites.SaveChanges();
     }
 }
 protected override void OnFlowEnd(T_E_BomFetchData entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     if (entity != null)
     {
         foreach (var item in entity.T_E_BomFetchData_BomDetail.ToList())
         {
             var pbom = this.EPCEntites.Set <S_P_Bom>().FirstOrDefault(c => c.ID == item.BomID);
             if (pbom == null)
             {
                 continue;
             }
             pbom.Attachment     = item.FetchData;
             pbom.AttachmentName = item.FetchDataName;
             pbom.FetchPacthID   = entity.ID;
             pbom.FactFetchDate  = entity.FetchFinishDate;
             pbom.FetchState     = ProjectState.Finish.ToString();
         }
         this.EPCEntites.SaveChanges();
     }
 }
예제 #25
0
 //
 // GET: /Procurement/Completed/
 //public override bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
 //{
 //    var entity = this.GetEntityByID<T_C_CompletedReturn>(taskExec.S_WF_InsFlow.FormInstanceID);
 //    if (routing.Code == "End")
 //    {
 //      var newprojectid=CreateNewProject(entity.Project);
 //        CreateNewOBS(entity.Project, newprojectid,entity.ChargeUser);
 //    }
 //    return base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);
 //}
 protected override void OnFlowEnd(T_C_CompletedReturn entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
 {
     //if (entity != null) {
     //    var newprojectid = CreateNewProject(entity.Project);
     //    if (newprojectid != "")
     //    {
     //        var engineeringInfo = FormulaHelper.GetEntities<EPCEntities>().Set<S_I_Engineering>().Find(newprojectid);
     //            //entities.S_I_Engineering.Find(newprojectid);
     //        engineeringInfo.SetOBSUser("ProjectManager", entity.ChargeUser);
     //        engineeringInfo.ChargerUser = entity.ChargeUser;
     //        engineeringInfo.ChargerUserName = entity.ChargeUserName;
     //        engineeringInfo.initModeCode();
     //        engineeringInfo.InitWBS();
     //        engineeringInfo.InitFolderTemplate();
     //        CreadPBSRoot(newprojectid);
     //        //CreateNewOBS(entity.Project, newprojectid, entity.ChargeUser);
     //    }
     //}
     base.OnFlowEnd(entity, taskExec, routing);
 }
        protected override void OnFlowEnd(S_SU_DocumentRelieveSeal entity, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            var detailIst = entity.S_SU_DocumentRelieveSeal_DetailList.ToList();
            var spaceList = new List <S_DOC_Space>();
            var spaceIDs  = detailIst.Where(a => !string.IsNullOrEmpty(a.SpaceID)).Select(a => a.SpaceID).ToList();

            foreach (var spaceID in spaceIDs)
            {
                var           nodeIds = detailIst.Where(a => a.SpaceID == spaceID && !string.IsNullOrEmpty(a.RelateID)).Select(a => a.RelateID);
                StringBuilder sb      = new StringBuilder();
                var           space   = spaceList.FirstOrDefault(a => a.ID == spaceID);
                if (space == null)
                {
                    space = DocConfigHelper.CreateConfigSpaceByID(spaceID);
                    spaceList.Add(space);
                }
                var db = SQLHelper.CreateSqlHelper(space.SpaceKey, space.ConnectString);
                foreach (var nodeid in nodeIds)
                {
                    sb.AppendLine("update S_NodeInfo set State = '" + DocState.Normal.ToString() + "',RackNumber='" + entity.RelieveSealRackNumber + "',RackNumberName='" + entity.RelieveSealRackNumberName + "',StorageRoom='" + entity.RelieveSealStorageRoom + "',StorageRoomName='" + entity.RelieveSealStorageRoomName + "' where FullPathID like '%" + nodeid + "%'");
                    sb.AppendLine("update S_FileInfo set State = '" + DocState.Normal.ToString() + "' where FullNodeID like '%" + nodeid + "%'");
                }
                if (sb.Length > 0)
                {
                    db.ExecuteNonQuery(sb.ToString());
                }
            }
            foreach (var detail in detailIst)
            {
                if (detail.RelateType.Equals("Node"))
                {
                    S_NodeInfo node = new S_NodeInfo(detail.RelateID, Formula.FormulaHelper.GetEntities <DocConfigEntities>().S_DOC_Space.FirstOrDefault(a => a.ID.Equals(detail.SpaceID)));
                    InventoryFO.CreateNewInventoryLedger(node, "\"库房\"修改为:\"" + entity.RelieveSealStorageRoomName + "\";\"货架号\"修改为:\"" + entity.RelieveSealRackNumberName + "\"", InventoryType.RelieveSeal);
                }
                else
                {
                    S_FileInfo file = new S_FileInfo(detail.RelateID, Formula.FormulaHelper.GetEntities <DocConfigEntities>().S_DOC_Space.FirstOrDefault(a => a.ID.Equals(detail.SpaceID)));
                    InventoryFO.CreateNewInventoryLedger(file, "\"库房\"修改为:\"" + entity.RelieveSealStorageRoomName + "\";\"货架号\"修改为:\"" + entity.RelieveSealRackNumberName + "\"", InventoryType.RelieveSeal);
                }
            }
        }
예제 #27
0
        public TaskDTO _GetTaskDetail(string id)
        {
            var formInstanceID = Request.RequestUri.ParseQueryString().Get("FormInstanceID");
            var userID         = Request.RequestUri.ParseQueryString().Get("UserID");
            var userAccount    = Request.RequestUri.ParseQueryString().Get("UserAccount");

            FormulaHelper.ContextSet("AgentUserLoginName", userAccount);

            S_WF_InsTaskExec task = GetTaskExec(id);
            TaskDTO          dto  = new TaskDTO();

            dto.ID                = task.ID;
            dto.CreateTime        = task.CreateTime;
            dto.FlowName          = task.S_WF_InsFlow.FlowName;
            dto.TaskName          = task.S_WF_InsTask.TaskName;
            dto.FlowCategory      = task.S_WF_InsFlow.FlowCategory;
            dto.FormInstanceID    = task.S_WF_InsFlow.FormInstanceID;
            dto.FormInstanceCode  = task.S_WF_InsFlow.S_WF_InsDefFlow.TableName;
            dto.FormDic           = task.S_WF_InsFlow.FormDic;
            dto.SendTaskUserNames = task.S_WF_InsTask.SendTaskUserNames;
            dto.CreateUserID      = task.S_WF_InsFlow.CreateUserID;
            dto.CreateUserName    = task.S_WF_InsFlow.CreateUserName;

            //新加字段
            dto.ExecTime     = task.ExecTime;
            dto.IsFinished   = task.ExecTime.HasValue;
            dto.TaskUserID   = task.ExecUserID;
            dto.TaskUserName = task.ExecUserName;
            dto.FlowDefCode  = task.S_WF_InsFlow.S_WF_InsDefFlow.Code;

            dto.Routines = GetRountineList(formInstanceID, id, dto.FormDic);


            dto.DefStepID   = task.S_WF_InsTask.S_WF_InsDefStep.DefStepID;
            dto.DefStepName = task.S_WF_InsTask.S_WF_InsDefStep.Name;

            dto.HideAdvice = task.S_WF_InsTask.S_WF_InsDefStep.HideAdvice == "1";

            FormulaHelper.ContextRemoveByKey("AgentUserLoginName");
            return(dto);
        }
        protected override void OnFlowEnd(T_CP_TaskNoticeChange ProjectInof, S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing)
        {
            ProjectEntities epcentity     = FormulaHelper.GetEntities <ProjectEntities>();
            string          ProjectInfoID = ProjectInof.ProjectInfoID;
            var             model         = epcentity.Set <T_CP_TaskNotice>().FirstOrDefault(a => a.ID == ProjectInfoID);

            if (model != null)
            {
                model.FirstDesignManager         = ProjectInof.FirstDesignManager;
                model.FirstDesignManagerName     = ProjectInof.FirstDesignManagerName;
                model.FirstDesignManagerDept     = ProjectInof.FirstDesignManagerDept;
                model.FirstDesignManagerDeptName = ProjectInof.FirstDesignManagerDeptName;
                model.SecondDesignManager        = ProjectInof.SecondDesignManager;
                model.SecondDesignManagerName    = ProjectInof.SecondDesignManagerName;
                model.ThirdDesignManager         = ProjectInof.ThirdDesignManager;
                model.ThirdDesignManagerName     = ProjectInof.ThirdDesignManagerName;
                model.DesignManagerAssistant     = ProjectInof.DesignManagerAssistant;
                model.DesignManagerAssistantName = ProjectInof.DesignManagerAssistantName;
                epcentity.SaveChanges();
            }
        }
        public override bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            if (routing.Code == "End")
            {
                var formInstanceID = taskExec.S_WF_InsFlow.FormInstanceID;
                var financeElectronicDocumentDownloadEntity = this.BusinessEntities.Set<T_FDM_FinanceElectronicDocumentDownload>().Find(formInstanceID);
                if (financeElectronicDocumentDownloadEntity == null)
                    throw new BusinessException("获取当前下载申请单失败,请联系管理员!");
                var deitals = financeElectronicDocumentDownloadEntity.T_FDM_FinanceElectronicDocumentDownload_Detail.ToList();
                if (deitals != null && deitals.Count > 0)
                {
                    var fedIds = deitals.Select(c => c.FinanceElectronicDocumentInfoID).ToArray();
                    var financeElectronicDocumentEntiys = this.BusinessEntities.Set<T_FDM_FinanceElectronicDocumentUpload>()
                        .Where(c => fedIds.Contains(c.ID)).ToList();
                    financeElectronicDocumentEntiys.Update(c => c.DownLoadCount = c.DownLoadCount + 1);
                    this.BusinessEntities.SaveChanges();
                }

            }
            return base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);
        }
예제 #30
0
        public override bool ExecTaskExec(S_WF_InsTaskExec taskExec, S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            var result = base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames,
                                           nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);
            var entity = this.GetEntityByID(taskExec.S_WF_InsFlow.FormInstanceID);

            if (entity == null)
            {
                throw new Formula.Exceptions.BusinessException("实体ID为空,未能找到相关实体对象,无法执行逻辑");
            }
            if (result)
            {
                this.OnFlowEnd(entity, taskExec, routing, nextExecUserIDs, nextExecUserNames,
                               nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);
            }
            else
            {
                this.OnExecute(entity, taskExec, routing, nextExecUserIDs, nextExecUserNames,
                               nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);
            }
            return(result);
        }