Пример #1
0
        public override bool ExecTaskExec(Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            var entity = this.BusinessEntities.Set <T_B_BorrowApply>().SingleOrDefault(c => c.ID == taskExec.S_WF_InsFlow.FormInstanceID);

            if (entity != null)
            {
                var state  = ItemState.Audit.ToString();
                var carIds = entity.T_B_BorrowApply_DetailInfo.Select(a => a.CarInfoID).ToArray();
                this.BusinessEntities.Set <S_CarInfo>().Where(a => carIds.Contains(a.ID)).Update(a => a.State = state);
                this.BusinessEntities.SaveChanges();
            }
            return(base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment));
        }
Пример #2
0
        protected override void OnFlowEnd(S_C_BOQ_Version entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            entity.State = "Publish";
            var detailList = EPCEntites.Set <S_C_BOQ_Version_Detail>().Where(a => a.VersionID == entity.ID).ToList();

            foreach (var item in detailList)
            {
                if (item.ModifyState == "Normal")
                {
                    continue;
                }
                var itemDic = FormulaHelper.ModelToDic <S_C_BOQ_Version_Detail>(item);
                if (item.ModifyState == "Add")
                {
                    S_C_BOQ boq = new S_C_BOQ();
                    boq.ID             = item.BOQID;
                    boq.Code           = item.Code;
                    boq.Name           = item.Name;
                    boq.Property       = item.Property;
                    boq.Quantity       = item.Quantity;
                    boq.Price          = item.Price;
                    boq.Remark         = item.Remark;
                    boq.Unit           = item.Unit;
                    boq.UnitPrice      = item.UnitPrice;
                    boq.VersionNo      = entity.VersionNumber;
                    boq.ContractInfoID = entity.ContractInfoID;
                    EPCEntites.Set <S_C_BOQ>().Add(boq);
                }
                else if (item.ModifyState == "Remove")
                {
                    EPCEntites.Set <S_C_BOQ>().Delete(a => a.ID == item.BOQID);
                }
                else if (item.ModifyState == "Modify")
                {
                    var boq = EPCEntites.Set <S_C_BOQ>().Find(item.BOQID);
                    if (boq == null)
                    {
                        boq    = new S_C_BOQ();
                        boq.ID = item.BOQID;
                    }
                    boq.VersionNo = entity.VersionNumber;
                    //boq._state
                    FormulaHelper.UpdateEntity <S_C_BOQ>(boq, itemDic, true);
                }
                else
                {
                    throw new Formula.Exceptions.BusinessValidationException(item.ModifyState + "没有if分支处理");
                }
            }
            EPCEntites.SaveChanges();
        }
Пример #3
0
 protected override void OnFlowEnd(S_P_Plan entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
 {
     if (entity != null)
     {
         if (entity.S_I_Engineering == null)
         {
             throw new Formula.Exceptions.BusinessValidationException("没有关联任何工程的采购计划无法进行发布");
         }
         entity.Push();
         this.EPCEntites.SaveChanges();
         entity.S_I_Engineering.ProcurementPlanToPBom();
         this.EPCEntites.SaveChanges();
     }
 }
Пример #4
0
        protected override void OnFlowEnd(T_M_ContractReview entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            base.OnFlowEnd(entity, taskExec, routing);
            //entity.ContractState = "Review";
            T_M_ContractReview contract = EPCEntites.Set <T_M_ContractReview>().Find(entity.ID);

            contract.Approver     = CurrentUserInfo.UserID;
            contract.ApproverName = CurrentUserInfo.UserName;
            contract.ApproverDate = DateTime.Now;
            //if (contract == null)
            //    throw new BusinessException("已无法找到id为【" + entity.Contract + "】的合同信息");
            //contract.ContractState = "Review";
            //EPCEntites.SaveChanges();
        }
Пример #5
0
        protected override void OnFlowEnd(T_Seal_Transfer entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var baseHelper = SQLHelper.CreateSqlHelper(ConnEnum.Base);
            var sql        = string.Format(@"update T_Seal_SealInfo 
    set DeptID=( select DeptID from {0}.dbo.S_A_User where ID='{1}'),
        DeptIDName=(select DeptName from {0}.dbo.S_A_User where ID='{1}'),
        KeeperID='{1}',
        KeeperIDName='{2}' 
where ID='{3}';", baseHelper.DbName, entity.ReceivePersonID, entity.ReceivePersonIDName, entity.SealInfoID);

            this.SQLDB.ExecuteNonQuery(sql);

            base.OnFlowEnd(entity, taskExec, routing);
        }
        protected override void OnFlowEnd(T_C_CreditNoteApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            entity.State = InvoiceApplyState.Wait.ToString();
            var contract = this.BusinessEntities.Set <S_C_ManageContract>().Find(entity.Contract);

            if (contract == null)
            {
                throw new Formula.Exceptions.BusinessException("没有找到对应的合同信息,开票操作失败");
            }
            entity.Submit();
            this.BusinessEntities.SaveChanges();
            contract.SummaryInvoiceData();
            this.BusinessEntities.SaveChanges();
        }
Пример #7
0
        protected override void OnFlowEnd(T_B_BidProcessApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            base.OnFlowEnd(entity, taskExec, routing);
            S_B_Bid bid = BusinessEntities.Set <S_B_Bid>().Find(entity.BidID);

            if (bid == null)
            {
                throw new BusinessException("id为【" + entity.BidID + "】投标数据为空");
            }
            bid.BidFile      = entity.BidFile;
            bid.BidClearFile = entity.BidClearFile;
            bid.BidOtherFile = entity.BidOtherFile;
            BusinessEntities.SaveChanges();
        }
Пример #8
0
        protected override void OnFlowEnd(T_EXE_PublishApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var publishInfo = this.GetEntityByID <S_EP_PublishInfo>(entity.ID);
            var majors      = EnumBaseHelper.GetEnumDef("Project.Major").EnumItem.ToList();

            if (publishInfo == null)
            {
                publishInfo = new S_EP_PublishInfo();
                this.BusinessEntities.Set <S_EP_PublishInfo>().Add(publishInfo);
            }
            this.UpdateEntity <S_EP_PublishInfo>(publishInfo, entity.ToDic());
            publishInfo.ID            = entity.ID;
            publishInfo.SubmitTime    = DateTime.Now;
            publishInfo.BelongYear    = ((DateTime)publishInfo.SubmitTime).Year;
            publishInfo.BelongMonth   = ((DateTime)publishInfo.SubmitTime).Month;
            publishInfo.BelongQuarter = ((publishInfo.BelongMonth - 1) / 3) + 1;
            var major = majors.FirstOrDefault(a => a.Code == publishInfo.MajorCode);

            if (major != null)
            {
                publishInfo.MajorName = major.Name;
            }
            foreach (var item in entity.T_EXE_PublishApply_PriceDetail)
            {
                var price = this.GetEntityByID <S_EP_PublishInfo_PriceDetail>(item.ID);
                if (price == null)
                {
                    price = new S_EP_PublishInfo_PriceDetail();
                    this.BusinessEntities.Set <S_EP_PublishInfo_PriceDetail>().Add(price);
                }
                this.UpdateEntity <S_EP_PublishInfo_PriceDetail>(price, item.ToDic());
                price.ID = item.ID;
                price.S_EP_PublishInfoID = publishInfo.ID;
            }
            foreach (var item in entity.T_EXE_PublishApply_Products)
            {
                var product = this.GetEntityByID <S_EP_PublishInfo_Products>(item.ID);
                if (product == null)
                {
                    product = new S_EP_PublishInfo_Products();
                    this.BusinessEntities.Set <S_EP_PublishInfo_Products>().Add(product);
                }
                this.UpdateEntity <S_EP_PublishInfo_Products>(product, item.ToDic());
                product.ID = item.ID;
                product.S_EP_PublishInfoID = publishInfo.ID;
            }
            entity.SetProductPrintState(PrintState.Printed.ToString());
            this.BusinessEntities.SaveChanges();
        }
Пример #9
0
        protected override void OnFlowEnd(T_B_BondApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            base.OnFlowEnd(entity, taskExec, routing);
            if (!BusinessEntities.Set <S_P_MarketClue>().Any(a => a.ID == entity.Project))
            {
                throw new BusinessException("未找到id为【" + entity.Project + "】的前期项目信息");
            }

            S_B_Bond bond = new S_B_Bond();

            FormulaHelper.UpdateEntity <S_B_Bond>(bond, entity.ToDic(), false);
            bond.ID    = entity.ID;
            bond.State = "NoReturn";
            BusinessEntities.Set <S_B_Bond>().Add(bond);
        }
        protected override void OnFlowEnd(T_Technology_ProjectProgress entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            if (entity != null)
            {
                if (string.IsNullOrEmpty(entity.RelateID))
                {
                    entity.RelateID = entity.ID;
                }


                BusinessEntities.SaveChanges();
            }

            base.OnFlowEnd(entity, taskExec, routing);
        }
Пример #11
0
        public override bool ExecTaskExec(Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            var bol = base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);

            if (routing.Code == "ToHR")
            {
                var formID = taskExec.S_WF_InsFlow.FormInstanceID;
                //反写流程表单ID至待审批资质
                string updateSql = string.Format("update  T_Qualification_Postqualificationmanagement set T_Qualification_PostTotalID = '{0}' where  isnull(IsApprove,'False')='False' ", formID);
                HRSQLDB.ExecuteNonQuery(updateSql);
            }


            return(bol);
        }
Пример #12
0
        //流程结束逻辑
        protected override void OnFlowEnd(T_SC_SchemeForm entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            string formData = Request["FormData"];
            Dictionary <string, string> dic = JsonHelper.ToObject <Dictionary <string, string> >(formData);
            var projectInfo    = this.GetEntityByID <S_I_ProjectInfo>(entity.ProjectInfoID);
            var marketEntities = Formula.FormulaHelper.GetEntities <Market.Logic.Domain.MarketEntities>();
            var marketProject  = marketEntities.Set <Market.Logic.Domain.S_I_Project>().FirstOrDefault(d => d.ID == projectInfo.MarketProjectInfoID);

            if (projectInfo.ProjectMode.ExtentionObject.GetValue("Ext_TemporaryMode") == TrueOrFalse.True.ToString())
            {
                var schemeDic = JsonHelper.ToObject <Dictionary <string, object> >(formData);
                var ignorKeys = new string[] { "CreateUserID", "CreateUser", "CreateDate", "State", "Major" };
                schemeDic.RemoveWhere(a => ignorKeys.Contains(a.Key));
                FormulaHelper.UpdateEntity(projectInfo, schemeDic);
                projectInfo.ReBuild();
                marketProject.Phase           = projectInfo.PhaseValue;
                marketProject.Name            = projectInfo.Name;
                marketProject.Code            = projectInfo.Code;
                marketProject.Phase           = projectInfo.PhaseValue;
                marketProject.ProjectClass    = projectInfo.ProjectClass;
                marketProject.Customer        = projectInfo.CustomerID;
                marketProject.CustomerName    = projectInfo.CustomerName;
                marketProject.CreateDate      = DateTime.Now;
                marketProject.EngineeringInfo = projectInfo.EngineeringInfoID;
                marketProject.ChargerDept     = projectInfo.ChargeDeptID;
                marketProject.ChargerDeptName = projectInfo.ChargeDeptName;
                marketProject.ChargerUser     = projectInfo.ChargeUserID;
                marketProject.ChargerUserName = projectInfo.ChargeUserName;
                marketProject.Country         = projectInfo.Country;
                marketProject.Province        = projectInfo.Province;
                marketProject.City            = projectInfo.City;
                marketProject.ProjectScale    = projectInfo.ProjectLevel.HasValue?projectInfo.ProjectLevel.Value.ToString():"";
            }
            if (entity != null)
            {
                entity.Push();
            }
            //if (entity != null)
            //    entity.Push(dic);
            if (marketProject != null)
            {
                marketProject.State = projectInfo.State;
            }
            marketEntities.SaveChanges();
            projectInfo.SynchMajorData(entity.Major);
            this.BusinessEntities.SaveChanges();
            projectInfo.BuildNotice();
        }
Пример #13
0
        protected override void OnFlowEnd(T_P_PaymentApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            if (entity != null)
            {
                var payment = entity.Push();

                payment.SetRelateInfo();

                //重新汇总合同上的实际付款数据
                var contract = this.GetEntityByID <S_P_ContractInfo>(entity.ContractInfo);
                contract.SummaryPaymentData();

                //重新汇总合同下各付款项的实际付款数据
                foreach (var item in contract.S_P_ContractInfo_PaymentObj.ToList())
                {
                    item.SummaryPaymentValue();
                }

                payment.ToCost(S_T_DefineParams.Params.GetValue("PaymentAutoSettle").ToLower() == "true");

                var entryInfoIDs      = entity.EntryInfo;
                var entryInfos        = this.EPCEntites.Set <T_W_WarehouseEntry>().Where(a => entryInfoIDs.Contains(a.ID)).ToList();
                var equipmentAccounts = this.EPCEntites.Set <S_W_EquipmentAccount>().Where(a => entryInfoIDs.Contains(a.FormID)).ToList();
                foreach (var entryInfo in entryInfos)
                {
                    foreach (var equipment in entryInfo.T_W_WarehouseEntry_EquipmentDetail.ToList())
                    {
                        equipment.RMBTotalPrice  = equipment.TotalPrice * entity.ExchangeRate;
                        equipment.RMBTaxPrice    = equipment.RMBTaxPrice / entryInfo.ExchangeRate * entity.ExchangeRate;
                        equipment.RMBTaxOutPrice = equipment.RMBTotalPrice - equipment.RMBTaxPrice;
                    }
                    entryInfo.ExchangeRate = entity.ExchangeRate;
                }
                foreach (var equipmentAccount in equipmentAccounts)
                {
                    var allAccounts = this.EPCEntites.Set <S_W_EquipmentAccount>().Where(a => a.RootID == equipmentAccount.ID);
                    foreach (var account in allAccounts)
                    {
                        account.RMBTotalPrice  = account.RMBTotalPrice / account.ExchangeRate * entity.ExchangeRate;
                        account.RMBTaxPrice    = account.RMBTaxPrice / account.ExchangeRate * entity.ExchangeRate;
                        account.RMBTaxOutPrice = account.RMBTotalPrice - account.RMBTaxPrice;
                        account.ExchangeRate   = entity.ExchangeRate;
                    }
                }

                this.EPCEntites.SaveChanges();
            }
        }
Пример #14
0
        //
        // GET: /AutoForm/SealRepeal/
        protected override void OnFlowEnd(T_Seal_Repeal entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            //修改印章刻制的废止状态
            var changeId = entity.SealInfoID;

            var changeEntity = BusinessEntities.Set <T_Seal_Change>().Find(changeId);

            if (changeEntity == null)
            {
                throw new Formula.Exceptions.BusinessException("印章刻制不存在");
            }

            changeEntity.SealStatus = "1";

            BusinessEntities.SaveChanges();
        }
        protected override void OnFlowEnd(T_SP_PaymentApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            if (entity != null)
            {
                if ((entity.BillValue ?? 0) > (entity.PaymentValue ?? 0))
                {
                    throw new Formula.Exceptions.BusinessValidationException("承兑汇票金额总和不能大于本次实际付款的金额");
                }

                entity.SavePayment();
                if (SysParams.Params.GetValue("SubContractConfirmMethod") == "PaymentConfirm")//委外付款确认
                {
                    ToCostInfo(entity);
                }
            }
            this.BusinessEntities.SaveChanges();
        }
        //流程结束逻辑
        protected override void OnFlowEnd(T_SC_SchemeForm_OEM_Szsow entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            string formData = Request["FormData"];
            Dictionary <string, string> dic = JsonHelper.ToObject <Dictionary <string, string> >(formData);

            if (entity != null)
            {
                entity.Push(dic);
            }
            var projectInfo = this.GetEntityByID <S_I_ProjectInfo>(entity.ProjectInfoID);

            //var marketEntities = Formula.FormulaHelper.GetEntities<Market.Logic.Domain.MarketEntities>();
            //var marketProject = marketEntities.Set<Market.Logic.Domain.S_I_Project>().FirstOrDefault(d => d.ID == projectInfo.MarketProjectInfoID);
            //if (marketProject != null)
            //    marketProject.State = projectInfo.State;
            //marketEntities.SaveChanges();
            this.BusinessEntities.SaveChanges();
        }
Пример #17
0
        protected override void OnFlowEnd(T_EXE_PublishApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var publishInfo = this.GetEntityByID <S_EP_PublishInfo>(entity.ID);

            if (publishInfo == null)
            {
                publishInfo = new S_EP_PublishInfo();
                this.BusinessEntities.Set <S_EP_PublishInfo>().Add(publishInfo);
            }
            this.UpdateEntity <S_EP_PublishInfo>(publishInfo, entity.ToDic());
            publishInfo.ID            = entity.ID;
            publishInfo.SubmitTime    = DateTime.Now;
            publishInfo.BelongYear    = ((DateTime)publishInfo.SubmitTime).Year;
            publishInfo.BelongMonth   = ((DateTime)publishInfo.SubmitTime).Month;
            publishInfo.BelongQuarter = ((publishInfo.BelongMonth - 1) / 3) + 1;
            foreach (var item in entity.T_EXE_PublishApply_PriceDetail)
            {
                var price = this.GetEntityByID <S_EP_PublishInfo_PriceDetail>(item.ID);
                if (price == null)
                {
                    price = new S_EP_PublishInfo_PriceDetail();
                    this.BusinessEntities.Set <S_EP_PublishInfo_PriceDetail>().Add(price);
                }
                this.UpdateEntity <S_EP_PublishInfo_PriceDetail>(price, item.ToDic());
                price.ID = item.ID;
                price.S_EP_PublishInfoID = publishInfo.ID;
            }
            foreach (var item in entity.T_EXE_PublishApply_Products)
            {
                var product = this.GetEntityByID <S_EP_PublishInfo_Products>(item.ID);
                if (product == null)
                {
                    product = new S_EP_PublishInfo_Products();
                    this.BusinessEntities.Set <S_EP_PublishInfo_Products>().Add(product);
                }
                this.UpdateEntity <S_EP_PublishInfo_Products>(product, item.ToDic());
                product.ID = item.ID;
                product.S_EP_PublishInfoID = publishInfo.ID;
            }

            entity.SetProductPrintState(PrintState.Printed.ToString());
            entity.SetProductSignUser();
            this.BusinessEntities.SaveChanges();
        }
        //此流程结束逻辑用于考勤导入功能
        protected override void OnFlowEnd(T_Evection_EvectionApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var user = baseEntities.Set <S_A_User>().FirstOrDefault(a => a.ID == entity.ApplyUser);

            if (user == null)
            {
                throw new Formula.Exceptions.BusinessValidationException("无法找到申请人【" + entity.ApplyUserName + "】");
            }
            var startDate   = DateTime.Parse(entity.StartTime.ToString());
            var endDate     = DateTime.Parse(entity.EndTime.ToString());
            var thisDate    = startDate;
            var holidayList = baseEntities.Set <S_C_Holiday>().ToList();
            var evection    = EnumBaseHelper.GetEnumDef("HR.AttendenceState").EnumItem.FirstOrDefault(a => a.Code == "出差").Name;

            while (thisDate <= endDate)
            {
                var holiday = holidayList.FirstOrDefault(a => a.Date == thisDate);
                if ((holiday != null && holiday.IsHoliday == "0") ||
                    (holiday == null && thisDate.DayOfWeek != DayOfWeek.Saturday && thisDate.DayOfWeek != DayOfWeek.Sunday))
                {
                    var attendanceInfo = this.ComprehensiveDbContext.Set <S_A_AttendanceInfo>().FirstOrDefault(a => a.Person == user.ID && a.Date == thisDate);
                    if (attendanceInfo == null)
                    {
                        attendanceInfo    = new S_A_AttendanceInfo();
                        attendanceInfo.ID = FormulaHelper.CreateGuid();
                        EntityCreateLogic <S_A_AttendanceInfo>(attendanceInfo);
                        attendanceInfo.Person     = user.ID;
                        attendanceInfo.PersonName = user.Name;
                        attendanceInfo.Dept       = user.DeptID;
                        attendanceInfo.DeptName   = user.DeptName;

                        attendanceInfo.Year  = thisDate.Year;
                        attendanceInfo.Month = thisDate.Month;
                        attendanceInfo.Date  = thisDate.Date;

                        this.ComprehensiveDbContext.Set <S_A_AttendanceInfo>().Add(attendanceInfo);
                    }
                    attendanceInfo.Morning   = evection;
                    attendanceInfo.Afternoon = evection;
                }
                thisDate = thisDate.AddDays(1);
            }
            this.ComprehensiveDbContext.SaveChanges();
        }
Пример #19
0
        protected override void OnFlowEnd(T_P_InvitationApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            if (entity != null)
            {
                var invitation = entity.Push();
                this.EPCEntites.SaveChanges();

                var deviceCount = entity.T_P_InvitationApply_DeviceList.Count;
                if (deviceCount > 0)
                {
                    string sql    = @"update S_P_Bom
set InvitationQuantity = (select Sum(InvitationQuantity) from S_P_Invitation_Device
where PBomID = S_P_Bom.ID)
where ID in ('{0}') ";
                    var    bomIDs = String.Join(",", invitation.S_P_Invitation_Device.Select(c => c.PBomID).ToList());
                    this.EPCSQLDB.ExecuteNonQuery(String.Format(sql, bomIDs.Replace(",", "','")));
                }
            }
        }
Пример #20
0
        protected override void OnFlowEnd(T_D_DownloadApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var carIds   = entity.T_D_DownloadApply_DetailInfo.Select(a => a.CarInfoID).ToArray();
            var carItems = this.BusinessEntities.Set <S_CarInfo>().Where(a => carIds.Contains(a.ID));

            foreach (var item in entity.T_D_DownloadApply_DetailInfo.ToList())
            {
                var carItem = carItems.FirstOrDefault(a => a.ID == item.CarInfoID);
                carItem.State = ItemState.Finish.ToString();

                #region 创建S_DownloadDetail
                int downloadExpireDate    = 7;
                var DocDownloadExpireDays = System.Configuration.ConfigurationManager.AppSettings["DocDownloadExpireDays"];
                if (!string.IsNullOrEmpty(DocDownloadExpireDays))
                {
                    downloadExpireDate = Convert.ToInt32(DocDownloadExpireDays);
                }
                S_DownloadDetail downloadDetail = new S_DownloadDetail
                {
                    ID                 = FormulaHelper.CreateGuid(),
                    DownloadID         = entity.ID,
                    Name               = item.Name,
                    Code               = item.Code,
                    SpaceID            = carItem.SpaceID,
                    ConfigID           = carItem.ConfigID,
                    FileID             = carItem.FileID,
                    CreateUserID       = entity.ApplyUser,
                    CreateUserName     = entity.ApplyUserName,
                    CreateDate         = DateTime.Now,
                    UserDeptID         = entity.ApplyDept,
                    UserDeptName       = entity.ApplyDeptName,
                    PassDate           = DateTime.Now,
                    DownloadState      = ItemState.Finish.ToString(),
                    DownloadExpireDate = Convert.ToDateTime(DateTime.Now.AddDays(downloadExpireDate).ToShortDateString() + " 23:59:59")
                };
                this.BusinessEntities.Set <S_DownloadDetail>().Add(downloadDetail);
                #endregion

                S_FileInfo file = new S_FileInfo(carItem.FileID, FormulaHelper.GetEntities <DocConfigEntities>().S_DOC_Space.FirstOrDefault(a => a.ID.Equals(carItem.SpaceID)));
                InventoryFO.CreateNewInventoryLedger(file, "", InventoryType.DownLoad);
            }
            this.BusinessEntities.SaveChanges();
        }
Пример #21
0
        protected override void OnFlowEnd(T_Foreign_Goabroadpersonal entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var mod = new S_E_Peerlist();

            mod.ID        = FormulaHelper.CreateGuid();
            mod.ApplyDate = entity.Applytime;
            mod.ApplyType = "因私出国";
            mod.T_Foreign_GoabroadapplybusinessID = entity.ID;
            mod.TaskName  = entity.Position;
            mod.UserID    = entity.ApplyUser;
            mod.UserName  = entity.ApplyUserName;
            mod.DeptID    = entity.Appledept;
            mod.DeptName  = entity.AppledeptName;
            mod.Code      = entity.ApplyCode;
            mod.Gocountry = entity.Country;

            BusinessEntities.Set <S_E_Peerlist>().Add(mod);

            BusinessEntities.SaveChanges();
        }
 protected override void OnFlowEnd(T_CP_CustomerRequestReview entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
 {
     if (entity != null)
     {
         if (entity.CanDo == "1")
         {
             var clue = BusinessEntities.Set <S_P_MarketClue>().Create();
             clue.ID = Formula.FormulaHelper.CreateGuid();
             clue.CustomerInfoName = entity.CustomerInfoName;
             clue.CustomerInfo     = entity.CustomerInfo;
             clue.Name             = entity.ProjectName;
             clue.Content          = entity.CustomerRequire;
             clue.State            = ClueState.Tracking.ToString();
             clue.CreateDate       = DateTime.Now;
             BusinessEntities.Set <S_P_MarketClue>().Add(clue);
             clue.Save();
         }
     }
     this.BusinessEntities.SaveChanges();
 }
        /// <summary>
        /// 标识申领流程
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="taskExec"></param>
        /// <param name="routing"></param>
        protected override void OnFlowEnd(T_SceneMark_Receive entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            if (entity != null)
            {
                //流程结束之后更新库存数量
                var lstDetail = BusinessEntities.Set <T_SceneMark_Receive_ReceiveDetail>().Where(x => x.T_SceneMark_ReceiveID == entity.ID);

                lstDetail.ToList().ForEach(x =>
                {
                    var dicModel = BusinessEntities.Set <T_SceneMark_Dictionaries>().FirstOrDefault(d => d.ID == x.DictID);
                    if (dicModel != null)
                    {
                        dicModel.StockQuantity = (Convert.ToInt32(dicModel.StockQuantity) - Convert.ToInt32(x.ReceiveQuantity)).ToString();
                    }
                });
                BusinessEntities.SaveChanges();
            }

            base.OnFlowEnd(entity, taskExec, routing);
        }
Пример #24
0
        public override bool ExecTaskExec(Workflow.Logic.Domain.S_WF_InsTaskExec taskExec,
                                          Workflow.Logic.Domain.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.BusinessValidationException("未能找到指定的表单数据,无法执行任务");
            }

            var supplier = this.GetEntityByID <S_I_SupplierInfo>(entity.SupplierInfo);

            if (supplier != null)
            {
                supplier.FlowPhase = entity.FlowPhase;
            }
            return(result);
        }
Пример #25
0
 protected override void OnFlowEnd(T_I_SupplierQualification entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
 {
     if (entity != null)
     {
         var supplier = this.GetEntityByID <S_I_SupplierInfo>(entity.SupplierInfo);
         if (supplier == null)
         {
             return;
         }
         if (entity.Result == true.ToString())
         {
             supplier.State = SupplierState.Qualification.ToString();
         }
         else
         {
             supplier.State = SupplierState.DisQualification.ToString();
         }
         supplier.LastChangeStateDate = DateTime.Now;
     }
 }
Пример #26
0
        protected override void OnFlowEnd(T_B_BorrowApply entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var carIds   = entity.T_B_BorrowApply_DetailInfo.Select(a => a.CarInfoID).ToArray();
            var carItems = this.BusinessEntities.Set <S_CarInfo>().Where(a => carIds.Contains(a.ID));

            foreach (var item in entity.T_B_BorrowApply_DetailInfo.ToList())
            {
                var carItem = carItems.FirstOrDefault(a => a.ID == item.CarInfoID);
                if (carItem != null)
                {
                    carItem.State = ItemState.Finish.ToString();

                    #region 创建S_BorrowDetail
                    S_BorrowDetail borrowDetail = new S_BorrowDetail
                    {
                        ID             = FormulaHelper.CreateGuid(),
                        BorrowID       = entity.ID,
                        SpaceID        = carItem.SpaceID,
                        SpaceName      = item.SpaceName,
                        DataType       = carItem.DataType,
                        DetailType     = string.IsNullOrEmpty(item.FileID) ? NodeType.Node.ToString() : NodeType.File.ToString(),
                        RelateID       = string.IsNullOrEmpty(item.FileID) ? item.NodeID : item.FileID,
                        ConfigID       = carItem.ConfigID,
                        Name           = item.Name,
                        Code           = item.Code,
                        CreateUserID   = entity.ApplyUser,
                        CreateUserName = entity.ApplyUserName,
                        CreateDeptID   = entity.ApplyDept,
                        CreateDeptName = entity.ApplyDeptName,
                        CreateDate     = DateTime.Now,
                        ApplyNumber    = item.ApplyAmount,
                        BorrowState    = BorrowDetailState.ToLend.ToString()
                    };
                    this.BusinessEntities.Set <S_BorrowDetail>().Add(borrowDetail);
                    #endregion
                }
                S_FileInfo file = new S_FileInfo(item.FileID, FormulaHelper.GetEntities <DocConfigEntities>().S_DOC_Space.FirstOrDefault(a => a.ID.Equals(item.SpaceID)));
                InventoryFO.CreateNewInventoryLedger(file, "", InventoryType.BorrowFile);
            }
            this.BusinessEntities.SaveChanges();
        }
Пример #27
0
        protected override void OnFlowEnd(T_P_ContractReview entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            base.OnFlowEnd(entity, taskExec, routing);
            S_P_ContractInfo contract = EPCEntites.Set <S_P_ContractInfo>().Find(entity.ContractInfo);

            if (contract == null)
            {
                throw new BusinessException("已无法找到id为【" + entity.ContractInfo + "】的采购合同信息");
            }
            contract.ContractState = "Review";

            //foreach (var content in contract.S_P_ContractInfo_Content)
            //{
            //    var tContent = entity.T_P_ContractReview_Content.FirstOrDefault(a => a.PBomID == content.PBomID);
            //    if(tContent != null)
            //    {
            //        content.SFZJ = tContent.SFZJ;
            //    }
            //}

            EPCEntites.SaveChanges();
        }
        //
        // GET: /AutoForm/Recruitment_Socialrecruitmentemployment/

        public override bool ExecTaskExec(Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            string ID = taskExec.S_WF_InsTask.S_WF_InsFlow.FormInstanceID;

            var entity = BusinessEntities.Set <T_Recruitment_Socialrecruitmentemployment>().Find(ID);

            if (routing.Code == "Pass")
            {
                entity.IsPass = "******";
                BusinessEntities.SaveChanges();
            }

            if (routing.Code == "NoPass")
            {
                entity.IsPass = "******";
                BusinessEntities.SaveChanges();
            }

            var isFlowComplete = base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);

            return(isFlowComplete);
        }
        protected override void OnFlowEnd(T_Monthlyreport_Monthlyreportfill entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var list = entity.T_Monthlyreport_Monthlyreportfill_Advice.ToList();

            foreach (var item in list)
            {
                var S_E_MonthAdvice = new S_E_MonthAdvice();
                S_E_MonthAdvice.ID             = FormulaHelper.CreateGuid();
                S_E_MonthAdvice.Advice         = item.Advice;
                S_E_MonthAdvice.BelongMonth    = Convert.ToDateTime(entity.Filldate).Month;
                S_E_MonthAdvice.BelongYear     = Convert.ToDateTime(entity.Filldate).Year;
                S_E_MonthAdvice.ContentOutline = item.Content;
                S_E_MonthAdvice.Dept           = item.Dept;
                S_E_MonthAdvice.DeptName       = item.DeptName;
                S_E_MonthAdvice.Filldate       = entity.Filldate;
                S_E_MonthAdvice.T_Monthlyreport_MonthlyreportfillID = item.T_Monthlyreport_MonthlyreportfillID;
                S_E_MonthAdvice.FillUserID   = entity.Fillname;
                S_E_MonthAdvice.FillUserName = entity.FillnameName;
                BusinessEntities.Set <S_E_MonthAdvice>().Add(S_E_MonthAdvice);
            }
            BusinessEntities.SaveChanges();
        }
Пример #30
0
        protected override void OnFlowEnd(S_F_CapitalCompanyPlan entity, Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing)
        {
            var detailList = EPCEntites.Set <S_F_CapitalCompanyPlan_Detail>().Where(a => a.S_F_BudgetProjectID == entity.ID).ToList();

            foreach (var detail in detailList)
            {
                //唯一数据
                S_F_CapitalAnalysis_Detail onlyOneDetail = EPCEntites.Set <S_F_CapitalAnalysis_Detail>().SingleOrDefault(
                    a => a.TemplateID == detail.TemplateID &&
                    a.TemplateCode == entity.TemplateCode &&
                    a.BudgetDate == detail.BudgetDate);

                //add
                if (onlyOneDetail == null)
                {
                    onlyOneDetail                  = new S_F_CapitalAnalysis_Detail();
                    onlyOneDetail.ID               = FormulaHelper.CreateGuid();
                    onlyOneDetail.TemplateCode     = entity.TemplateCode;
                    onlyOneDetail.TemplateID       = detail.TemplateID;
                    onlyOneDetail.ParentTemplateID = detail.ParentTemplateID;
                    onlyOneDetail.FullTemplateID   = detail.FullTemplateID;
                    onlyOneDetail.IsReadOnly       = detail.IsReadOnly;
                    onlyOneDetail.SortIndex        = detail.SortIndex;
                    onlyOneDetail.Name             = detail.Name;
                    onlyOneDetail.BudgetDate       = detail.BudgetDate;
                    onlyOneDetail.Year             = detail.Year;
                    onlyOneDetail.Month            = detail.Month;
                    onlyOneDetail.CapitalPlanType  = detail.CapitalPlanType;
                    onlyOneDetail.SourceSQL        = detail.SourceSQL;
                    onlyOneDetail.RealSourceSQL    = detail.RealSourceSQL;
                    onlyOneDetail.SourceLink       = detail.SourceLink;
                    onlyOneDetail.RealSourceLink   = detail.RealSourceLink;
                    EPCEntites.Set <S_F_CapitalAnalysis_Detail>().Add(onlyOneDetail);
                }

                onlyOneDetail.BudgetValue = detail.BudgetValue;
            }
        }