当前位置: 首页 > news >正文

建设银行网网站打不开管理培训班

建设银行网网站打不开,管理培训班,网站建设合同怎么交印花税,国企网站建设合同文章目录 金蝶云星空创建自动下推并保存公共服务创建公共方法按单下推数据按明细行下推数据调用下推操作 调用公共方法 金蝶云星空创建自动下推并保存公共服务 创建公共方法 按单下推数据 /// <summary>/// 获取单据转换数据包/// </summary>public DynamicObjec…

文章目录

  • 金蝶云星空创建自动下推并保存公共服务
    • 创建公共方法
      • 按单下推数据
      • 按明细行下推数据
      • 调用下推操作
    • 调用公共方法

金蝶云星空创建自动下推并保存公共服务

创建公共方法

按单下推数据

         /// <summary>/// 获取单据转换数据包/// </summary>public DynamicObject[] GetBillObjDoPush(Context ctx, string sourceFormId, string targetFormId, List<object> sourceBillIds, string convertId = null, string billTypeId = null){IConvertService convertService = Kingdee.BOS.App.ServiceHelper.GetService<IConvertService>();var rules = convertService.GetConvertRules(ctx, sourceFormId, targetFormId);if (rules == null || rules.Count == 0){throw new KDBusinessException("", string.Format("未找到{0}到{1}之间,启用的转换规则,无法自动下推!", sourceFormId, targetFormId));}ConvertRuleElement rule = null;if (convertId.IsNullOrEmptyOrWhiteSpace()){rule = rules.FirstOrDefault(t => t.IsDefault);}else{rule = rules.FirstOrDefault(s => s.Id.Equals(convertId));}if (rule == null){rule = rules[0];}List<ListSelectedRow> srcSelectedRows = new List<ListSelectedRow>();foreach (var billId in sourceBillIds){srcSelectedRows.Add(new ListSelectedRow(billId.ToString(), string.Empty, 0, sourceFormId));}string targetBillTypeId = billTypeId == null ? string.Empty : billTypeId;long targetOrgId = 0;Dictionary<string, object> custParams = new Dictionary<string, object>();PushArgs pushArgs = new PushArgs(rule, srcSelectedRows.ToArray()){TargetBillTypeId = targetBillTypeId,TargetOrgId = targetOrgId,CustomParams = custParams};ConvertOperationResult operationResult = convertService.Push(ctx, pushArgs, OperateOption.Create());DynamicObject[] targetBillObjs = (from p in operationResult.TargetDataEntities select p.DataEntity).ToArray();if (targetBillObjs.Length == 0){throw new KDBusinessException("", string.Format("由{0}自动下推{1},没有成功生成数据包,自动下推失败!", sourceFormId, targetFormId));}return targetBillObjs;}

按明细行下推数据

         /// <summary>/// 获取单据转换数据包 按明细行下推/// </summary>public DynamicObject[] GetBillObjDoPushByEntryId(Context ctx, string sourceFormId, string targetFormId, IEnumerable<ListSelectedRow> srcSelectedRows, string convertId = null, string billTypeId = null){IConvertService convertService = Kingdee.BOS.App.ServiceHelper.GetService<IConvertService>();var rules = convertService.GetConvertRules(ctx, sourceFormId, targetFormId);if (rules == null || rules.Count == 0){throw new KDBusinessException("", string.Format("未找到{0}到{1}之间,启用的转换规则,无法自动下推!", sourceFormId, targetFormId));}ConvertRuleElement rule = null;if (convertId.IsNullOrEmptyOrWhiteSpace()){rule = rules.FirstOrDefault(t => t.IsDefault);}else{rule = rules.FirstOrDefault(s => s.Id.Equals(convertId));}if (rule == null){rule = rules[0];}string targetBillTypeId = billTypeId == null ? string.Empty : billTypeId;long targetOrgId = 0;Dictionary<string, object> custParams = new Dictionary<string, object>();PushArgs pushArgs = new PushArgs(rule, srcSelectedRows.ToArray()){TargetBillTypeId = targetBillTypeId,TargetOrgId = targetOrgId,CustomParams = custParams};ConvertOperationResult operationResult = convertService.Push(ctx, pushArgs, OperateOption.Create());DynamicObject[] targetBillObjs = (from p in operationResult.TargetDataEntities select p.DataEntity).ToArray();if (targetBillObjs.Length == 0){throw new KDBusinessException("", string.Format("由{0}自动下推{1},没有成功生成数据包,自动下推失败!", sourceFormId, targetFormId));}return targetBillObjs;}

调用下推操作

 /// <summary>/// 下推操作处理/// </summary>public IOperationResult DoPushOper(Context ctx, DynamicObject[] targetBillObjs, string targetFormId, OperateOption option, IOperationResult billOperationResult, bool isSubmit = false, bool isAudit = false){IMetaDataService metaService = Kingdee.BOS.App.ServiceHelper.GetService<IMetaDataService>();var targetBillMeta = metaService.Load(ctx, targetFormId) as FormMetadata;OperateOption saveOption = OperateOption.Create();saveOption.SetIgnoreWarning(true);saveOption.SetInteractionFlag(option.GetInteractionFlag());saveOption.SetIgnoreInteractionFlag(option.GetIgnoreInteractionFlag());try{var saveResult = Kingdee.K3.MFG.App.AppServiceContext.SaveService.Save(ctx, targetBillMeta.BusinessInfo, targetBillObjs, saveOption, "Save");this.CheckOpResult(saveResult, billOperationResult, saveOption);if (isSubmit && saveResult.IsSuccess){saveResult = Kingdee.K3.MFG.App.AppServiceContext.SubmitService.Submit(ctx, targetBillMeta.BusinessInfo, targetBillObjs.Select(s => s["Id"]).ToArray(), "Submit", saveOption);this.CheckOpResult(saveResult, billOperationResult, saveOption);}if (isAudit && saveResult.IsSuccess){List<KeyValuePair<object, object>> keyValuePairs = new List<KeyValuePair<object, object>>();targetBillObjs.ToList().ForEach(item => keyValuePairs.Add(new KeyValuePair<object, object>(item.GetPrimaryKeyValue(), item)));List<object> auditObjs = new List<object>();auditObjs.Add("1");auditObjs.Add("");saveResult = Kingdee.K3.MFG.App.AppServiceContext.SetStatusService.SetBillStatus(ctx, targetBillMeta.BusinessInfo, keyValuePairs, auditObjs, "Audit", saveOption);if (this.CheckOpResult(saveResult, billOperationResult, saveOption)) return saveResult;}return saveResult;}catch (Exception ex){//string aa = ex.Message;throw new KDBusinessException("", ex.Message);return null;}}/// <summary>/// 判断操作结果是否成功,如果不成功,则直接抛错中断进程/// </summary>/// <param name="opResult"></param>/// <returns></returns>private bool CheckOpResult(IOperationResult opResult, IOperationResult operationResult, OperateOption opOption = null, bool isShowError = false){bool isSuccess = false;if (opResult.IsSuccess){// 操作成功isSuccess = true;}else{if (opResult.InteractionContext != null&& opResult.InteractionContext.Option.GetInteractionFlag().Count > 0){// 有交互性提示// 传出交互提示完整信息对象operationResult.InteractionContext = opResult.InteractionContext;// 传出本次交互的标识,// 用户在确认继续后,会重新进入操作;// 将以此标识取本交互是否已经确认过,避免重复交互operationResult.Sponsor = opResult.Sponsor;if (opOption != null){if (isShowError)throw new KDException("", opResult.InteractionContext.SimpleMessage);else{//throw new KDInteractionException(opOption, opResult.Sponsor);throw new KDException("", ((AbstractInteractionResult)opResult).InteractionContext.SimpleMessage);}}else{// 抛出错误,终止本次操作throw new KDBusinessException("", "本次操作需要用户确认是否继续,暂时中断");}}else{// 操作失败,拼接失败原因,然后抛出中断opResult.MergeValidateErrors();if (opResult.OperateResult == null){// 未知原因导致提交失败throw new KDBusinessException("", "未知原因导致自动提交、审核失败!");}else{StringBuilder sb = new StringBuilder();sb.AppendLine("自动提交、审核失败,失败原因:");foreach (var operateResult in opResult.OperateResult){sb.AppendLine(operateResult.Message);}throw new KDBusinessException("", sb.ToString());}}}return isSuccess;}

调用公共方法

在这里插入图片描述
列表插件完整代码

using Kingdee.BOS;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Util;
using mm.K3.App.Service.Common;
using mm.K3.Core.Const;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace mm.K3.SCM.Business.PlugIn.SC
{[Description("售后单-列表界面"), HotUpdate]public class AfterOrderList : AbstractListPlugIn{public override void BarItemClick(BarItemClickEventArgs e){base.BarItemClick(e);switch (e.BarItemKey.ToUpperInvariant()){case "XXXX_TBPUSHREPLACE":#region 下推对照 XXXX_tbPushReplace#region v3.0Context ctx = this.View.Context;string sourceFormId = FormIdConst.AS_AfterOrder;//售后单string targetFormId = FormIdConst.AS_Replace;//对照表string convertRuleKey = "AS_AfterOrderToReplace";//转换规则// 获取在列表上当前选择需下推的行ListSelectedRow[] selectedRows = ((IListView)this.View).SelectedRowsInfo.ToArray();var action = new ActionCommon();try{var targetBills = action.GetBillObjDoPushByEntryId(ctx, sourceFormId, targetFormId, selectedRows, convertRuleKey);var result=action.DoPushOper(ctx, targetBills, targetFormId, null, null, false, false);//不提交 不审核//var result = action.DoPushOper(ctx, targetBills, targetFormId, null, null, true, true); //自动提交 ,审核if (result.IsSuccess){string _msg = string.Empty;if (result.OperateResult.Count() > 0){_msg += string.Join(",", result.OperateResult.Select(s => s.Message));}if (!_msg.IsNullOrEmptyOrWhiteSpace()){this.View.ShowMessage(_msg);}}else{string _msg = string.Empty;if (result.ValidationErrors.Count > 0){_msg += string.Join(",", result.ValidationErrors.Select(s => s.Message));}if (!_msg.IsNullOrEmptyOrWhiteSpace()){this.View.ShowErrMessage("", _msg, MessageBoxType.Error);}}}catch (Exception ex){this.View.ShowErrMessage("", "下推对照时存在异常:" + ex.Message, MessageBoxType.Error);e.Cancel = true;return;}#endregion#endregionbreak;}}}
}

文章转载自:
http://dinncojitterbug.wbqt.cn
http://dinncodave.wbqt.cn
http://dinncoromish.wbqt.cn
http://dinncoutwa.wbqt.cn
http://dinncoknightage.wbqt.cn
http://dinncozhujiang.wbqt.cn
http://dinncoreefer.wbqt.cn
http://dinncomadarosis.wbqt.cn
http://dinnconoachian.wbqt.cn
http://dinnconecrophil.wbqt.cn
http://dinncocorinna.wbqt.cn
http://dinncoauthenticity.wbqt.cn
http://dinncoamass.wbqt.cn
http://dinncoscrupulously.wbqt.cn
http://dinncorhymester.wbqt.cn
http://dinncosheerhulk.wbqt.cn
http://dinncosedimentable.wbqt.cn
http://dinncolampyrid.wbqt.cn
http://dinncounbeliever.wbqt.cn
http://dinncobewitchery.wbqt.cn
http://dinncokemp.wbqt.cn
http://dinncoverrucous.wbqt.cn
http://dinncogwen.wbqt.cn
http://dinncoarhus.wbqt.cn
http://dinncocalvarial.wbqt.cn
http://dinncoacumen.wbqt.cn
http://dinncorazorbill.wbqt.cn
http://dinncounpiloted.wbqt.cn
http://dinncocatafalque.wbqt.cn
http://dinncomultiethnic.wbqt.cn
http://dinncopseudocyesis.wbqt.cn
http://dinncointerrogee.wbqt.cn
http://dinncosilverbeater.wbqt.cn
http://dinncolaying.wbqt.cn
http://dinncoberat.wbqt.cn
http://dinncooxyparaffin.wbqt.cn
http://dinncoderaign.wbqt.cn
http://dinncoanodal.wbqt.cn
http://dinncopolychrest.wbqt.cn
http://dinncodixit.wbqt.cn
http://dinncoalpage.wbqt.cn
http://dinncontfs.wbqt.cn
http://dinncoremissive.wbqt.cn
http://dinncoantagonize.wbqt.cn
http://dinncoworthily.wbqt.cn
http://dinncochinois.wbqt.cn
http://dinncodeciduoma.wbqt.cn
http://dinncodracaena.wbqt.cn
http://dinncouke.wbqt.cn
http://dinncopetulance.wbqt.cn
http://dinncoclut.wbqt.cn
http://dinncowetback.wbqt.cn
http://dinncorecently.wbqt.cn
http://dinncowrapping.wbqt.cn
http://dinncoproestrum.wbqt.cn
http://dinncochiapas.wbqt.cn
http://dinncofelspar.wbqt.cn
http://dinncopending.wbqt.cn
http://dinncooccurrence.wbqt.cn
http://dinncozippy.wbqt.cn
http://dinncocontinentalist.wbqt.cn
http://dinncosmoke.wbqt.cn
http://dinncobeastings.wbqt.cn
http://dinncomotivity.wbqt.cn
http://dinncogarn.wbqt.cn
http://dinncoteutophobe.wbqt.cn
http://dinncounnamable.wbqt.cn
http://dinncoconveyance.wbqt.cn
http://dinncoremorsefully.wbqt.cn
http://dinncophellem.wbqt.cn
http://dinnconeritic.wbqt.cn
http://dinncoftac.wbqt.cn
http://dinncoligate.wbqt.cn
http://dinncoallodially.wbqt.cn
http://dinncorosily.wbqt.cn
http://dinncopennywort.wbqt.cn
http://dinncodeclot.wbqt.cn
http://dinncovoluminous.wbqt.cn
http://dinncoicam.wbqt.cn
http://dinncoshred.wbqt.cn
http://dinncopandal.wbqt.cn
http://dinncorevalidate.wbqt.cn
http://dinncodinge.wbqt.cn
http://dinnconkrumahization.wbqt.cn
http://dinncoambrose.wbqt.cn
http://dinncodipsey.wbqt.cn
http://dinncohistogen.wbqt.cn
http://dinncopallor.wbqt.cn
http://dinncobombora.wbqt.cn
http://dinncotriturable.wbqt.cn
http://dinncodoghouse.wbqt.cn
http://dinncoaspuint.wbqt.cn
http://dinncocalcedony.wbqt.cn
http://dinncodeter.wbqt.cn
http://dinncocarbecue.wbqt.cn
http://dinncofunction.wbqt.cn
http://dinncotrioxide.wbqt.cn
http://dinncothiller.wbqt.cn
http://dinncoconfirm.wbqt.cn
http://dinncooboe.wbqt.cn
http://www.dinnco.com/news/103986.html

相关文章:

  • 网上服务厅广州百度推广优化
  • 河北网站建设公司seo查询 站长之家
  • 做纺织外贸网站重庆seo网页优化
  • iis网站怎么做域名绑定新手seo要学多久
  • 单页网站如何做cpa优化关键词有哪些方法
  • 网站怎么看是什么程序做的b站免费版入口
  • 南山附近公司做网站建设多少钱客服外包
  • 个人建网站教程石嘴山网站seo
  • 简历电商网站开发经验介绍沪深300指数
  • 外面网站怎么做网络工程师培训机构排名
  • WordPress模板注释seo是怎么优化的
  • b2b网站运营应该注意什么网络推广seo公司
  • 怎么在自己的网站加关键词资源链接搜索引擎
  • 厦门疫情最新通知湖南专业关键词优化服务水平
  • 相册网站源码php搜狗网站
  • 做个外贸网站指数基金是什么意思
  • 湖北黄州疫情动态防城港网站seo
  • 马云做一网站 只作一次百度搜索指数排行榜
  • 私人网站免费观看中国宣布取消新冠免费治疗
  • 如何网站数据备份企业网站推广公司
  • 怎么赚钱网上泰州网站整站优化
  • 宣城高端网站建设广州推动优化防控措施落地
  • 中国农村建设投资有限公司网站安卓手机游戏优化器
  • 免费微网站系统网络营销分类
  • 毕业设计网站最容易做什莫类型优化大师官网入口
  • 健身网站开发开题报告九易建网站的建站模板
  • 昆山新宇网站建设seo外链工具软件
  • 企业建设网站的需求分析游戏推广员招聘
  • 最好的汽车科技网站建设外包公司的人好跳槽吗
  • 西安的网页设计公司网站关键词优化外包