예제 #1
0
 public override void EndOperationTransaction(EndOperationTransactionArgs e)
 {
     base.EndOperationTransaction(e);
     //如果分录存在项目进展为丢单,改行丢单原因必填
     if (e.DataEntitys != null && e.DataEntitys.Count() > 0)
     {
         foreach (DynamicObject item in e.DataEntitys)
         {
             DynamicObjectCollection ProductDetails = item["PEJK_Cust_ProductDetail"] as DynamicObjectCollection;
             if (ProductDetails.Count() > 0)
             {
                 foreach (DynamicObject ProductDetail in ProductDetails)
                 {
                     if (Convert.ToString(((DynamicObject)ProductDetail["F_PEJK_ProProcess"])["Name"]).Equals("丢单"))
                     {
                         if (ProductDetail["F_PEJK_DDRESON"] == null || ProductDetail["F_PEJK_DDRESON"].ToString().Equals("") || ProductDetail["F_PEJK_DDRESON"].ToString().Equals(" "))
                         {
                             throw new KDBusinessException("", string.Format("单据第{0}行,项目进展为丢单,丢单原因未填写!", ProductDetail["Seq"]));
                         }
                     }
                 }
             }
         }
     }
 }
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            IViewService Services = ServiceHelper.GetService <IViewService>();

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService <IMetaDataService>();


                foreach (DynamicObject dy in selectedRows)
                {
                    string Id = Convert.ToString(dy["Id"]);

                    if (dy["SZXY_TFJCDEntry2"] is DynamicObjectCollection Entry)
                    {
                        foreach (var item in Entry)
                        {
                            decimal PlyAvg = Convert.ToDecimal(item["F_SZXY_PLyAvg"]);

                            string TFCode = Convert.ToString(item["F_SZXY_TFNo1"]);
                            if (!TFCode.IsNullOrEmptyOrWhiteSpace() && Convert.ToInt32(PlyAvg) > 0)
                            {
                                string sql1 = $"/*dialect*/update SZXY_t_XYTFEntry  set F_SZXY_SJPLY={PlyAvg} " +
                                              $" where F_SZXY_COATCODE='{TFCode}' ";

                                DBServiceHelper.Execute(Context, sql1);
                            }
                        }
                    }
                }
            }
        }
예제 #3
0
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            IViewService Services = ServiceHelper.GetService <IViewService>();

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService <IMetaDataService>();
                //string SoureFormId = "SZXY_FHJTRSCJH";
                //获取单据元数据
                //FormMetadata BilMetada = metadataService.Load(Context, SoureFormId) as FormMetadata;

                foreach (DynamicObject dy in selectedRows)
                {
                    string Id = Convert.ToString(dy["Id"]);


                    if (dy["SZXY_XYLSEntry1"] is DynamicObjectCollection Entrys)
                    {
                        foreach (var item in Entrys.Where(op => !Convert.ToString(op["F_SZXY_PlasticNo1"]).IsNullOrEmptyOrWhiteSpace()))
                        {
                            string FHNo = Convert.ToString(item["F_SZXY_PlasticNo1"]);

                            if (!FHNo.IsNullOrEmptyOrWhiteSpace())
                            {
                                //改写流转状态
                                string UpdateStateSql = string.Format("/*dialect*/update SZXY_t_XYFH set  F_SZXY_Integer={0}   where F_SZXY_RecNo='{1}' ", 0, Convert.ToString(FHNo));
                                int    res            = DBServiceHelper.Execute(Context, UpdateStateSql);
                            }
                        }
                    }
                }
            }
        }
예제 #4
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            if (e.DataEntitys.Length == 0)
            {
                return;
            }

            var dataObj = e.DataEntitys[0];
            var strDesc = string.Format("保存插件测试,单据编号为:{0},采购日期为:{1}的采购订单保存成功!"
                                        , dataObj["BillNo"], dataObj["Date"]);
            LogObject logObj = new LogObject()
            {
                pkValue      = dataObj["Id"].ToString(),
                Description  = strDesc,
                OperateName  = this.FormOperation.OperationName,
                ObjectTypeId = this.BusinessInfo.GetForm().Id,
                SubSystemId  = this.BusinessInfo.GetForm().SubsysId,
                Environment  = OperatingEnvironment.BizOperate
            };

            ILogService logService = ServiceHelper.GetService <ILogService>();

            logService.WriteLog(this.Context, logObj);
        }
예제 #5
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            if (e.DataEntitys == null || e.DataEntitys.Count() < 0)
            {
                return;
            }

            //AbstractModifySalOrder modify = new ModifySalOrderPlugIn();
            List <DynamicObject> dataEntitys = e.DataEntitys.ToList();

            List <K3SalOrderInfo>     orders  = GetOrders(dataEntitys);
            List <HttpResponseResult> results = null /*modify.SendRequest(this.Context, orders, RequestType.LOCK)*/;

            if (results != null)
            {
                if (results.GroupBy(r => r.Success == true).ToList().Count != 1)
                {
                    throw new Exception("不符合合单条件");
                }
            }
            else
            {
                throw new Exception("Redis服务器没有反应!");
            }
        }
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            IViewService Services = ServiceHelper.GetService <IViewService>();

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService <IMetaDataService>();
                string           SoureFormId     = "SZXY_FHJTRSCJH";
                //获取单据元数据
                FormMetadata BilMetada = metadataService.Load(Context, SoureFormId) as FormMetadata;

                foreach (DynamicObject dy in selectedRows)
                {
                    string  Id       = Convert.ToString(dy["Id"]);
                    decimal Area     = 0;
                    string  RJHFid   = string.Empty;
                    string  RJHRowId = string.Empty;
                    RJHFid   = Convert.ToString(dy["F_SZXY_FIDH"]);
                    Area     = Convert.ToDecimal(dy["F_SZXY_ProdArea"]);
                    RJHRowId = Convert.ToString(dy["F_SZXY_FEntryIDH"]);


                    if (Area > 0 && !RJHFid.IsNullOrEmptyOrWhiteSpace() && Convert.ToInt32(RJHFid) > 0 && Convert.ToInt32(RJHRowId) > 0)
                    {
                        //单据头反写复合日计划实际完成面积

                        string sql1 = $"/*dialect*/update SZXY_t_LSJTRSCJHEntry  set F_SZXY_ProdArea=F_SZXY_ProdArea-{Area} " +
                                      $"  where Fid={RJHFid}" +
                                      $" and FEntryID={RJHRowId} ";
                        DBServiceHelper.Execute(Context, sql1);
                    }
                }
            }
        }
예제 #7
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            List <DynamicObject> objs = e.DataEntitys.ToList();

            if (objs != null && objs.Count > 0)
            {
                foreach (var item in objs)
                {
                    if (item != null)
                    {
                        DynamicObject oSource     = item["F_HS_SaleOrderSource"] as DynamicObject;
                        string        orderSource = SQLUtils.GetFieldValue(oSource, "FNumber");

                        string documentStatus = SQLUtils.GetFieldValue(item, "DocumentStatus");

                        if (!string.IsNullOrWhiteSpace(orderSource) && !string.IsNullOrWhiteSpace(documentStatus))
                        {
                            if ((orderSource.CompareTo("HCWebPendingOder") != 0 && orderSource.CompareTo("HCWebProcessingOder") != 0) && (documentStatus.CompareTo("C") != 0 || documentStatus.CompareTo("B") != 0))
                            {
                                SynchroDataHelper.SynchroDataToHC(this.Context, this.DataType);
                                break;
                            }
                        }
                    }
                }
            }
        }
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                foreach (DynamicObject dy in selectedRows)
                {
                    string  Id   = Convert.ToString(dy["Id"]);
                    decimal Area = 0;

                    string RJHRowId = string.Empty;

                    if (dy["SZXY_BZDHEntry"] is DynamicObjectCollection Entry)
                    {
                        foreach (var item in Entry)
                        {
                            Area = Convert.ToDecimal(item["F_SZXY_AREA1"]);
                            //反写日计划实际完成面积
                            RJHRowId = Convert.ToString(item["F_SZXY_RJHEntryIDH"]);
                            if (!RJHRowId.IsNullOrEmptyOrWhiteSpace() && Convert.ToInt32(RJHRowId) > 0)
                            {
                                string sql1 = $"/*dialect*/update SZXY_t_BZRSCJHEntry  set F_SZXY_PRODUCTIONAREA=F_SZXY_PRODUCTIONAREA-{Area} " +
                                              $"  where  FEntryID={RJHRowId}";
                                DBServiceHelper.Execute(Context, sql1);
                            }
                        }
                    }
                }
            }
        }
예제 #9
0
 public override void EndOperationTransaction(EndOperationTransactionArgs e)
 {
     base.EndOperationTransaction(e);
     //平均单价等于当前月份1号-账存日期之间该库存组织下的采购入库单物料的平均单价
     if (e.DataEntitys != null && e.DataEntitys.Count <DynamicObject>() > 0)
     {
         foreach (DynamicObject item in e.DataEntitys)
         {
             DateTime dt    = Convert.ToDateTime(item["BackUpDate"]);
             long     orgId = Convert.ToInt64(item["StockOrgId_Id"]);
             DynamicObjectCollection doc = item["StkCountInputEntry"] as DynamicObjectCollection;
             foreach (DynamicObject dot in doc)
             {
                 long   fentryid   = Convert.ToInt64(dot["Id"]);
                 long   materialId = Convert.ToInt64(dot["MaterialId_Id"]);
                 string strSql     = string.Format(@"/*dialect*/select sum(c.FAMOUNT)/sum(b.FREALQTY) from t_STK_InStock a inner join t_stk_instockentry b on a.FID = b.FID inner join T_STK_INSTOCKENTRY_F c on a.FID = c.FID where a.FSTOCKORGID = {0} and b.FMATERIALID = {1} and a.FDATE >= DATEADD(MM,DATEDIFF(MM,0,GETDATE()),0) and a.FDATE <'{2}'", orgId, materialId, dt.ToShortDateString());
                 double result     = DBUtils.ExecuteScalar <Double>(this.Context, strSql, 0.0, null);
                 if (result != 0.0)
                 {
                     string updateSql = string.Format(@"/*dialect*/update T_STK_STKCOUNTINPUTENTRY set F_LHR_PRICE = {0} where FENTRYID = {1}", result, fentryid);
                     DBUtils.Execute(this.Context, updateSql);
                 }
             }
         }
     }
 }
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            IViewService Services = ServiceHelper.GetService <IViewService>();

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                //IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService<IMetaDataService>();


                foreach (DynamicObject dy in selectedRows)
                {
                    string Id = Convert.ToString(dy["Id"]);


                    string LSNo = Convert.ToString(dy["F_SZXY_ProductNo"]);
                    if (LSNo != "" && !LSNo.IsNullOrEmptyOrWhiteSpace())
                    {
                        //改写流转状态
                        string UpdateStateSql = string.Format("/*dialect*/update SZXY_t_XYLS set  F_SZXY_CIRCULATIONSTATE1={0}   where F_SZXY_RECNO='{1}' ", 0, LSNo);
                        int    res            = DBServiceHelper.Execute(Context, UpdateStateSql);
                    }
                }
            }
        }
        /// <summary>
        /// 操作已经完成,事务未提交时触发:同步删除下游单据数据
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            // 本单主键为字符串类型,略过
            if (this.BusinessInfo.GetForm().PkFieldType == EnumPkFieldType.STRING)
            {
                return;
            }

            // 把单据数据包,展开为按实体Key为标识存储的数据字典
            ExtendedDataEntitySet dataEntitySet = new ExtendedDataEntitySet();

            dataEntitySet.Parse(e.DataEntitys, this.BusinessInfo);

            // 对各单据体进行循环,分别扫描下游单据,逐单删除
            foreach (var entity in this.BusinessInfo.Entrys)
            {
                // 判断此实体,是否需要扫描下游单据
                if (this.IgnoreEntity(entity))
                {
                    continue;
                }

                // 取实体数据集合
                ExtendedDataEntity[] rows = dataEntitySet.FindByEntityKey(entity.Key);
                if (rows == null)
                {
                    // 容错
                    continue;
                }

                // 取实体的业务流程数据
                HashSet <long> entityIds = new HashSet <long>();
                foreach (var row in rows)
                {
                    long entityId = Convert.ToInt64(row.DataEntity[0]);
                    entityIds.Add(entityId);
                }
                BusinessFlowInstanceCollection bfInstances = this.LoadBFInstance(entity.Key, entityIds);
                if (bfInstances == null || bfInstances.Count == 0)
                {
                    // 无关联的业务流程实例,略过
                    continue;
                }

                // 从业务流程实例中,分析出本单据体的下游单据内码:按目标单据体分好组
                Dictionary <string, HashSet <long> > dctTargetEntityIds = this.GetTargetEntityIds(
                    entity, entityIds, bfInstances);

                // 对各种下游单据进行循环,逐个删除
                foreach (var targetBill in dctTargetEntityIds)
                {
                    IOperationResult deleteResult = this.DeleteTargetBill(targetBill.Key, targetBill.Value);
                    if (CheckOpResult(deleteResult) == false)
                    {
                        // 删除失败,无需继续,退出
                        return;
                    }
                }
            }
        }
예제 #12
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            foreach (var entity in e.DataEntitys)
            {
                string FID  = entity["Id"].ToString();
                string sql  = "select * from ora_t_Renewal where FID='" + FID + "'";
                var    objs = DBUtils.ExecuteDynamicObject(this.Context, sql);
                if (objs.Count > 0)
                {
                    string FEndDate       = objs[0]["FEndDate"] == null ? "" : objs[0]["FEndDate"].ToString();
                    string F_ora_SignYear = objs[0]["F_ora_SignYear"].ToString();
                    if (FEndDate != "")
                    {
                        FEndDate = DateTime.Parse(FEndDate).AddYears(int.Parse(F_ora_SignYear)).ToString();
                    }

                    string F_ora_Level        = objs[0]["F_ora_Level"].ToString();
                    string F_ora_ContractType = objs[0]["F_ora_ContractType"].ToString();
                    string F_ora_Workplace    = objs[0]["F_ora_Workplace"].ToString();
                    string FApplyID           = objs[0]["FApplyID"].ToString();
                    sql = string.Format(@"UPDATE T_HR_EMPINFO SET F_HR_RANK='{0}' WHERE FID='{1}';
			        UPDATE T_BD_PERSON SET FWORKADDRESS='{2}', FCONTRACTTYPE='{3}', FHTDateEnd='{4}' WHERE FID='{5}';"            ,
                                        F_ora_Level, FApplyID, F_ora_Workplace, F_ora_ContractType, FEndDate, FApplyID);
                    DBUtils.Execute(this.Context, sql);
                }
            }
        }
예제 #13
0
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            IViewService Services = ServiceHelper.GetService <IViewService>();

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService <IMetaDataService>();

                foreach (DynamicObject dy in selectedRows)
                {
                    string  Id   = Convert.ToString(dy["Id"]);
                    decimal Area = 0;

                    string RJHRowId = string.Empty;


                    if (dy["SZXY_SFDEntry"] is DynamicObjectCollection Entry)
                    {
                        foreach (var item in Entry)
                        {
                            Area = Convert.ToDecimal(item["F_SZXY_AREA"]);
                            //反写日计划实际完成面积
                            RJHRowId = Convert.ToString(item["F_SZXY_RJHEntryID"]);
                            if (!RJHRowId.IsNullOrEmptyOrWhiteSpace() && Convert.ToInt32(RJHRowId) > 0)
                            {
                                string sql1 = $"/*dialect*/update SZXY_t_SFJTRSCJHEntry  set F_SZXY_ProductionArea=F_SZXY_ProductionArea+{Area} " +
                                              $" where FEntryID={RJHRowId} ";
                                DBServiceHelper.Execute(Context, sql1);
                            }
                        }
                    }
                }
            }
        }
예제 #14
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            //test();
            base.EndOperationTransaction(e);

            /*
             * 标准件入库单
             * 单据头
             * 入库单号
             * 项目号
             * 单据体
             * 物料编号
             * 数量
             * 批号
             * ************************************
             * 外协件入库单
             * 单据头
             * 入库单号
             * 项目号
             * 单据体
             * 物料编号
             * 数量
             * 批号
             * 外协计划号
             */
            if (e.DataEntitys != null && e.DataEntitys.Count <DynamicObject>() > 0)
            {
                foreach (DynamicObject DataEntity in e.DataEntitys)
                {
                    //标准采购入库
                    if (Convert.ToString(((DynamicObject)DataEntity["StockOrgId"])["Number"]).Equals("0168"))
                    {
                        DynamicObjectCollection inStockEntrys = DataEntity["InStockEntry"] as DynamicObjectCollection;
                        if (!Convert.ToString(((DynamicObject)inStockEntrys[0]["MaterialId"])["Name"]).Contains("标准件"))
                        {
                            string sJon = CreateJson(DataEntity);
                            if (!sJon.Equals("传递参数拼接失败"))
                            {
                                //ResManager
                                //调用MES提供的接口
                                WebMesTest.MaterialMessageFromCappServiceService requestMes = new WebMesTest.MaterialMessageFromCappServiceService();
                                string mesResult = requestMes.StorageMessageFromKis(sJon);
                                if (!mesResult.Equals("0"))//传递失败
                                {
                                    throw new Exception(mesResult);
                                }
                            }
                        }
                    }


                    //外协采购入库
                    //else if (Convert.ToString(DataEntity["FBillTypeID"]).Equals(""))
                    //{
                    //    CreateJson(DataEntity);
                    //}
                }
            }
        }
예제 #15
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            List <DynamicObject> objects = e.DataEntitys.ToList();

            result = OperateAfterAudit(this.Context, objects);
        }
예제 #16
0
 public override void EndOperationTransaction(EndOperationTransactionArgs e)
 {
     base.EndOperationTransaction(e);
     //商业机会审核自动将商机状态更新为执行中。
     object[] pkValues = (from c in e.DataEntitys
                          select c[0]).ToArray();//提交成功的结果
     CRMServiceHelper.setState(base.Context, "T_CRM_Opportunity", "FDOCUMENTSTATUS", "G", "FID", pkValues);
 }
예제 #17
0
 public override void EndOperationTransaction(EndOperationTransactionArgs e)
 {
     try
     {
         if (e.DataEntitys != null && e.DataEntitys.Count <DynamicObject>() > 0)
         {
             foreach (DynamicObject item in e.DataEntitys)
             {
                 string FID             = item["Id"].ToString();
                 string FSetAccountType = item["FSetAccountType"].ToString();
                 if (FSetAccountType == "2" || FSetAccountType == "1")//暂估
                 {
                     string upsql           = "";
                     string F_YBG_Assistant = item["F_YBG_Assistant_Id"].ToString();
                     string sql             = string.Format(@"select FNUMBER  From T_BAS_ASSISTANTDATAENTRY  where FENTRYID='{0}'", F_YBG_Assistant);
                     //编码
                     string FNUMBER = DBServiceHelper.ExecuteScalar <string>(this.Context, sql, "0", null);
                     if (!FNUMBER.Contains("SN"))
                     {
                         //更新暂估应收
                         upsql = string.Format(@"/*dialect*/ update t_AR_receivableEntry set FIsLockPrice=1  where FID ='{0}'", FID);
                     }
                     else
                     {
                         //更新暂估应收
                         upsql = string.Format(@"/*dialect*/ update t_AR_receivableEntry set FIsLockPrice=0  where FID ='{0}'", FID);
                     }
                     //更新锁库字段
                     DBServiceHelper.Execute(Context, upsql);
                 }
                 //else
                 //{
                 //    string upsql = "";
                 //    string sql = string.Format(@"select arel.FSID from t_AR_receivable ar inner join t_AR_receivableEntry arE on ar.FID=arE.FID
                 //                           inner join T_AR_RECEIVABLEENTRY_LK arel on arel.FENTRYID=are.FENTRYID where ar.FID='{0}'", FID);
                 //    DataSet ds = DBServiceHelper.ExecuteDataSet(this.Context, sql);
                 //    DataTable dt = ds.Tables[0];
                 //    if (dt.Rows.Count > 0)
                 //    {
                 //        for (int i = 0; i < dt.Rows.Count; i++)
                 //        {
                 //            string FSID = dt.Rows[i]["FSID"].ToString();
                 //            //更新暂估应收
                 //            upsql += string.Format(@"/*dialect*/ update t_AR_receivableEntry set FIsLockPrice=1  where FENTRYID ='{0}'", FSID);
                 //        }
                 //    }
                 //    //锁定价格
                 //    DBServiceHelper.Execute(Context, upsql);
                 //}
             }
         }
     }
     catch (Exception ex)
     {
         throw new KDException("", "保存失败:" + ex.ToString());
     }
 }
예제 #18
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            if (e.DataEntitys != null && e.DataEntitys.Count() > 0)
            {
                foreach (DynamicObject DataEntity in e.DataEntitys)
                {
                    if (Convert.ToString(DataEntity["CONTACTUNITTYPE"]).Equals("BD_Customer"))
                    {
                        if (XSXServiceHelper.XSXServiceHelper.IsYQYCust(this.Context, Convert.ToInt64(DataEntity["CONTACTUNIT_Id"])))
                        {
                            orgNumber         = Convert.ToString(((DynamicObject)DataEntity["FPAYORGID"])["Number"]);
                            belongCustNumbaer = Convert.ToString(((DynamicObject)DataEntity["FBelongCust"])["Number"]);
                            //门店加盟费业务类型为空
                            //ywlxTypeNo = Convert.ToString(((DynamicObject)DataEntity["FYWTYPE"])["Number"]);
                            shBrandNo = Convert.ToString(((DynamicObject)DataEntity["FSHBRAND"])["Number"]);
                            shRegion  = Convert.ToString(((DynamicObject)DataEntity["FSHREGION"])["Number"]);
                            long BillID = Convert.ToInt64(DataEntity["Id"]);
                            DynamicObjectCollection RECEIVEBILLENTRY = DataEntity["RECEIVEBILLENTRY"] as DynamicObjectCollection;
                            if (Convert.ToInt64(RECEIVEBILLENTRY[0]["PURPOSEID_Id"]) == ConstantBaseData.MDJMFID)
                            {
                                Action <IDynamicFormViewService> fillBillPropertys = new Action <IDynamicFormViewService>(fillPropertys);
                                DynamicObject    billModel  = XSXServiceHelper.XSXServiceHelper.CreateBillMode(this.Context, "ER_ExpenseRequest", fillBillPropertys);
                                IOperationResult saveResult = XSXServiceHelper.XSXServiceHelper.Save(this.Context, "ER_ExpenseRequest", billModel);
                                XSXServiceHelper.XSXServiceHelper.Log(this.Context, "Save", saveResult);
                                if (!saveResult.IsSuccess)
                                {
                                    StringBuilder sb = new StringBuilder();
                                    sb.AppendLine("自动创建费用申请单失败原因:");
                                    foreach (var operateResult in saveResult.OperateResult)
                                    {
                                        sb.AppendLine(operateResult.Message);
                                    }
                                    throw new KDBusinessException("AutoOperate", sb.ToString());
                                }
                                if (saveResult.IsSuccess)
                                {
                                    //反写"已生成费用申请单",并反写单据编号
                                    string costRequestNum = saveResult.OperateResult[0].Number;
                                    string updateSql      = string.Format(@"/*dialect*/Update T_AR_RECEIVEBILL set FISCREATEAPPLY = 1,FCOSTAPPLYNO = '{0}' where FID = {1}", costRequestNum, BillID);
                                    DBUtils.Execute(this.Context, updateSql);
                                }
                            }
                            //收款用途,门店加盟费的ID:113486,******根据实际编码进行修改******
                            //string strSql = string.Format(@"/*dialect*/SELECT COUNT(*) NUM FROM T_AR_RECEIVEBILL AR INNER JOIN T_AR_RECEIVEBILLENTRY ARY ON AR.FID = ARY.FID WHERE ARY.FPURPOSEID = 113486 AND AR.FID = {0}", BillID);
                            //int num = DBUtils.ExecuteScalar<int>(this.Context, strSql, -1, null);
                            //收付款用途:xx加盟费,客户类型=门店
                            //if (num >= 1)//生成费用申请单
                            // {

                            //}
                        }
                    }
                }
            }
        }
예제 #19
0
파일: Delete.cs 프로젝트: hypnosis01/shudev
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            List <string> list = (from obj in e.DataEntitys select Convert.ToString(obj["Id"])).ToList <string>();

            if (list.Count > 0)
            {
                new BudgetReportPlateService().DeleteBudgetValueById(base.Context, list);
            }
            base.EndOperationTransaction(e);
        }
예제 #20
0
        /// <summary>
        ///累加日计划面积
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            IViewService Services = ServiceHelper.GetService <IViewService>();

            if (selectedRows != null && selectedRows.Count() != 0)
            {
                IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService <IMetaDataService>();
                //string SoureFormId = "SZXY_FHJTRSCJH";
                //获取单据元数据
                //FormMetadata BilMetada = metadataService.Load(Context, SoureFormId) as FormMetadata;

                foreach (DynamicObject dy in selectedRows)
                {
                    string  Id       = Convert.ToString(dy["Id"]);
                    decimal Area     = 0;
                    string  RJHFid   = string.Empty;
                    string  RJHRowId = string.Empty;
                    //RJHFid = Convert.ToString(dy["F_SZXY_FIDH"]);
                    //Area = Convert.ToDecimal(dy["F_SZXY_Area"]);
                    //RJHRowId = Convert.ToString(dy["F_SZXY_RJHEntryID"]);


                    if (dy["SZXY_XYFQEntry"] is DynamicObjectCollection Entry)
                    {
                        foreach (var item in Entry)
                        {
                            Area = Convert.ToDecimal(item["F_SZXY_AREA"]);
                            //反写日计划实际完成面积
                            RJHRowId = Convert.ToString(item["F_SZXY_RJHEntryID"]);
                            if (!RJHRowId.IsNullOrEmptyOrWhiteSpace() && Convert.ToInt32(RJHRowId) > 0)
                            {
                                string sql1 = $"/*dialect*/update SZXY_t_FQJTRSCJHEntry  set F_SZXY_ProductionArea=F_SZXY_ProductionArea-{Area}," +
                                              $"  where  FEntryID={RJHRowId}";

                                DBServiceHelper.Execute(Context, sql1);
                            }
                        }
                    }

                    //string SelSql = $"/*dialect*/select * from SZXY_t_XYFQEntry where SZXY_t_XYFQEntry.Fid={Id} ";
                    //DataSet SelDS= DBServiceHelper.ExecuteDataSet(Context, SelSql);

                    //if (SelDS != null && SelDS.Tables.Count > 0 && SelDS.Tables[0].Rows.Count > 0)
                    //{

                    //}

                    string SelSql = $"/*dialect*/insert into SZXY_t_XYFQEntry select  * from SZXY_t_XYFQEntryCopy where SZXY_t_XYFQEntryCopy.Fid={Id} ";
                    DBServiceHelper.Execute(Context, SelSql);
                    string DelSql = $"/*dialect*/delete from SZXY_t_XYFQEntryCopy  where SZXY_t_XYFQEntryCopy.Fid ={Id} ";
                    DBServiceHelper.Execute(Context, DelSql);
                }
            }
        }
예제 #21
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            if (e.DataEntitys.Length > 0)
            {
                var dataObj = e.DataEntitys[0];

                dataObj["Date"] = new DateTime(2012, 1, 1);
            }
        }
예제 #22
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            List <DynamicObject> objects = e.DataEntitys.ToList();
            HttpResponseResult   result  = OperateAfterAudit(this.Context, objects);

            if (result != null && !result.Success && !string.IsNullOrWhiteSpace(result.Message))
            {
                throw new Exception(result.Message);
            }
        }
예제 #23
0
 /// <summary>
 /// 审核操作服务
 /// </summary>
 /// <param name="e"></param>
 public override void EndOperationTransaction(EndOperationTransactionArgs e)
 {
     try
     {
         string sql = string.Empty;
         if (e.DataEntitys != null && e.DataEntitys.Count <DynamicObject>() > 0)
         {
             foreach (DynamicObject item in e.DataEntitys)
             {
                 //收款单id
                 string Fid = item["Id"].ToString();
                 #region 注释
                 //sql = string.Format(@"select FORDERBILLNO,FORDERENTRYID,b.FREALRECAMOUNT from T_AR_RECEIVEBILL a
                 //                      inner join T_AR_RECEIVEBILLSRCENTRY b  on a.FID=b.fid
                 //                      where a.FID='{0}'", Fid);
                 //DataSet ds = DBServiceHelper.ExecuteDataSet(this.Context,sql);
                 //DataTable dt = ds.Tables[0];
                 //if (dt.Rows.Count > 0)
                 //{
                 //    string upsql = "";
                 //    for (int i = 0; i < dt.Rows.Count; i++)
                 //    {
                 //        //订单明细内码
                 //        string FORDERENTRYID = dt.Rows[i]["FORDERENTRYID"].ToString();
                 //        //本次收款金额
                 //        decimal FREALRECAMOUNT = Convert.ToDecimal(dt.Rows[i]["FREALRECAMOUNT"].ToString());
                 //        upsql += string.Format(@"/*dialect*/ update T_SAL_ORDERENTRY set FREALRECAMOUNT={0} where FENTRYID={1}", FREALRECAMOUNT, FORDERENTRYID);
                 //    }
                 //    //更新销售订单
                 //    DBServiceHelper.Execute(Context,upsql);
                 //}
                 #endregion
                 string upsql = "";
                 //收款单源单明细
                 DynamicObjectCollection RECEIVEBILLSRCENTRYList = item["RECEIVEBILLSRCENTRY"] as DynamicObjectCollection;
                 foreach (var entry in RECEIVEBILLSRCENTRYList)
                 {
                     //销售订单明细内码
                     string FORDERENTRYID = entry["FSRCORDERENTRYID"].ToString();
                     //本次收款金额
                     decimal FREALRECAMOUNT = Convert.ToDecimal(entry["REALRECAMOUNT"].ToString());
                     upsql += string.Format(@"/*dialect*/ update T_SAL_ORDERENTRY set FREALRECAMOUNT={0}+FREALRECAMOUNT  where FENTRYID={1}", FREALRECAMOUNT, FORDERENTRYID);
                 }
                 //更新销售订单
                 DBServiceHelper.Execute(Context, upsql);
             }
         }
     }
     catch (Exception ex)
     {
         throw new KDException("", "审核失败:" + ex.ToString());
     }
 }
예제 #24
0
 public override void EndOperationTransaction(EndOperationTransactionArgs e)
 {
     base.EndOperationTransaction(e);
     if (e.DataEntitys != null && e.DataEntitys.Count <DynamicObject>() > 0)
     {
         foreach (DynamicObject item in e.DataEntitys)
         {
             string   custId = Convert.ToString(item["FCUSTID_ID"]);
             string[] pkIds  = new string[] { custId };
             TLMBServiceHelper.SetState(this.Context, "BD_Customer", pkIds, "FCUSTID", "T_BD_CUSTOMER", "FForbidStatus", "B");
         }
     }
 }
예제 #25
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            string opKey = this.FormOperation.Operation.ToUpperInvariant();

            switch (opKey)
            {
            case "AUDIT":
                foreach (var dataEntity in e.DataEntitys)
                {
                    CreateOrder(dataEntity);
                }
                break;
            }
        }
예제 #26
0
        //输单操作校验器
        //public override void OnAddValidators(AddValidatorsEventArgs e)
        //{
        //    base.OnAddValidators(e);
        //    LoseContractValidator loseValidator = new LoseContractValidator();
        //    loseValidator.EntityKey = "FBillHead";
        //    e.Validators.Add(loseValidator);
        //}

        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            if (e.DataEntitys != null && e.DataEntitys.Count() > 0)
            {
                foreach (DynamicObject item in e.DataEntitys)
                {
                    string reason = Convert.ToString(item["FWinReason"]);
                    if (reason.Equals(" "))
                    {
                        throw new KDBusinessException("", string.Format("商机编号{0}输赢原因没填,输单操作失败!", item["FBillNo"]));
                    }
                }
            }
        }
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            if (this.BusinessInfo.GetForm().Id.CompareTo("SAL_SaleOrder") == 0)
            {
                List <DynamicObject> offline      = null;
                List <DynamicObject> online       = null;
                List <DynamicObject> dropshipping = null;
                this.DyamicObjects = e.DataEntitys.ToList();

                offline = this.DyamicObjects.Where(o =>
                {
                    DynamicObject oType = o["F_HS_SaleOrderSource"] as DynamicObject;
                    return(SQLUtils.GetFieldValue(oType, "FNumber").CompareTo("XXBJDD") == 0);
                }).ToList();

                online = this.DyamicObjects.Where(o =>
                {
                    DynamicObject oType = o["F_HS_SaleOrderSource"] as DynamicObject;
                    string orderSrc     = SQLUtils.GetFieldValue(oType, "FNumber");
                    return(orderSrc.CompareTo("HCWebPendingOder") == 0 || orderSrc.CompareTo("HCWebProcessingOder") == 0);
                }).ToList();

                dropshipping = this.DyamicObjects.Where(o =>
                {
                    DynamicObject oType = o["F_HS_SaleOrderSource"] as DynamicObject;
                    string orderSrc     = SQLUtils.GetFieldValue(oType, "FNumber");
                    return(orderSrc.CompareTo("DropShippingOrder") == 0);
                }).ToList();

                if (offline != null && offline.Count > 0)
                {
                    SalOrderType = "offline";
                    result       = OperateAfterAudit(this.Context, offline);
                }
                if (online != null && online.Count > 0)
                {
                    SalOrderType = "online";
                    result       = OperateAfterAudit(this.Context, online);
                }
                if (dropshipping != null && dropshipping.Count > 0)
                {
                    SalOrderType = "dropshipping";
                    result       = OperateAfterAudit(this.Context, dropshipping);
                }
            }
        }
예제 #28
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            string          strSql = "INSERT INTO t_demo_purServTest(FID,FNAME,FCREATEDATE) VALUES(@ID,@NAME,@CREATEDATE)";
            List <SqlParam> paras  = new List <SqlParam> {
                new SqlParam("@ID", KDDbType.Int32, DateTime.Now.Second),
                new SqlParam("@Name", KDDbType.String, "EndOperationTransaction"),
                new SqlParam("@CREATEDATE", KDDbType.DateTime, DateTime.Now)
            };

            DBUtils.Execute(this.Context, strSql, paras);

            strSql = "TRUNCATE table T_DEMO_PURDDLTest";
            DBUtils.Execute(this.Context, strSql);
            throw new Exception("测试服务插件抛出异常");
        }
예제 #29
0
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            foreach (var entity in e.DataEntitys)
            {
                string FAfterDeptID = entity["FAfterDeptID"] == null ? "0" : (entity["FAfterDeptID"] as DynamicObject)["Id"].ToString();
                string FAfterPost   = entity["FAfterPost"] == null ? "0" : (entity["FAfterPost"] as DynamicObject)["Id"].ToString();
                string FAfterLevel  = entity["FAfterLevel"] == null ? "0" : (entity["FAfterLevel"] as DynamicObject)["Id"].ToString();
                string FProbation   = entity["FProbation"] == null ? "" : entity["FProbation"].ToString();
                string F_ora_toDate = entity["F_ora_toDate"] == null ? "" : entity["F_ora_toDate"].ToString();
                string FApplyID     = entity["FApplyID"] == null ? "0" : (entity["FApplyID"] as DynamicObject)["Id"].ToString();
                string sql          = string.Format(@"UPDATE T_HR_EMPINFO SET F_HR_RANK='{0}', F_ORA_POST='{1}', F_ORA_DEPTID='{2}' WHERE FID='{3}';
			    UPDATE T_BD_PERSON SET FProbation='{4}', F_ora_toDate='{5}' WHERE FID='{6}';"            ,
                                                    FAfterLevel, FAfterPost, FAfterDeptID, FApplyID, FProbation, F_ora_toDate, FApplyID);
                DBUtils.ExecuteDynamicObject(this.Context, sql);
            }
        }
예제 #30
0
        /// <summary>
        /// 保存成功后,自动提交审核
        /// </summary>
        /// <param name="e"></param>
        public override void EndOperationTransaction(EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);
            object[] ids = (from p in e.DataEntitys.Where(p => (Convert.ToString(p["DOCUMENTSTATUS"]).Equals("A") || Convert.ToString(p["DOCUMENTSTATUS"]).Equals("D")))
                            select p[0]).ToArray();//获取收付款用途不等于加盟费的单据ID
            IOperationResult submitResult = XSXServiceHelper.XSXServiceHelper.Submit(this.Context, "DE_SCMS_ApplyGools", ids);

            XSXServiceHelper.XSXServiceHelper.Log(this.Context, "Submit", submitResult);
            if (submitResult.IsSuccess)
            {
                object[] ips = (from c in submitResult.SuccessDataEnity
                                select c[0]).ToArray();
                IOperationResult auditResult = XSXServiceHelper.XSXServiceHelper.Audit(this.Context, "DE_SCMS_ApplyGools", ips);
                XSXServiceHelper.XSXServiceHelper.Log(this.Context, "Audit", auditResult);
            }
        }