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

山东省住房城乡建设厅查询网站wordpress 执行顺序

山东省住房城乡建设厅查询网站,wordpress 执行顺序,wordpress上传图片路径修改,太原seo管理实现目的:在金蝶ERP采购申请列表界面,勾选某些行采购申请物料信息后,点击按钮推送到第三方系统。实现思路:通过WebService方式实现两个系统间的数据交互。实现过程:1、新建项目,然后通过Visual Studio IDE工…

实现目的:

在金蝶ERP采购申请列表界面,勾选某些行采购申请物料信息后,点击按钮推送到第三方系统。

实现思路:

通过WebService方式实现两个系统间的数据交互。

实现过程:

1、新建项目,然后通过Visual Studio IDE工具解析第三方WebService服务端地址,具体参照网上教程。

2、项目的app.config配置如下:

<?xml version="1.0" encoding="utf-8" ?>
<configuration><system.serviceModel><bindings><basicHttpBinding><binding name="BatchInsertPendingPurchaseDataServiceSoap" /></basicHttpBinding></bindings><client><endpoint address="http://192.168.23.250/BatchInsertPendingPurchaseDataService.asmx"binding="basicHttpBinding" bindingConfiguration="BatchInsertPendingPurchaseDataServiceSoap"contract="WebServiceClient.BatchInsertPendingPurchaseDataServiceSoap"name="BatchInsertPendingPurchaseDataServiceSoap" /></client></system.serviceModel>
</configuration>

3、创建WebService客户端调用程序:

using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using K3Cloud.Purchase.Requisition.WebServiceClient;namespace K3Cloud.Purchase.Requisition
{public class BachInsertPendingPurchaseDataClient{public static string BachInsertData(List<DataItem> dataItems){try{string Url = "http://192.168.23.250/BatchInsertPendingPurchaseDataService.asmx";// 动态创建绑定和终结点var binding = new BasicHttpBinding();var endpoint = new EndpointAddress(Url);// 使用动态配置创建客户端using (var client = new BatchInsertPendingPurchaseDataServiceSoapClient(binding, endpoint)){return client.BatchInsertData(dataItems.ToArray());}}catch (Exception ex){Console.WriteLine($"调用WebService时发生错误: {ex.Message}");if (ex.InnerException != null){Console.WriteLine($"内部错误: {ex.InnerException.Message}");}return ex.Message;}}}
}

4、新建列表插件,获取选中的列表行数据,然后调用WebService传输数据:

using Kingdee.BOS;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;using Kingdee.BOS.Core.List;using Kingdee.BOS.Core.List.PlugIn;using Kingdee.BOS.Util;
using System.Collections.Generic;
using System.ComponentModel;using System.Linq;
using System.Data;
using K3Cloud.Purchase.Requisition.TRMWebServiceClient;
using System;namespace K3Cloud.Purchase.Requisition
{public class PushPurchaseRequisition:AbstractListPlugIn{public override void BarItemClick(BarItemClickEventArgs e){base.BarItemClick(e);if (e.BarItemKey.EqualsIgnoreCase("tbGetListSelectedRows")){var lv = this.View as IListView;if (lv == null){return;}ListSelectedRowCollection selectedRows = lv.SelectedRowsInfo;if (selectedRows == null || selectedRows.Count == 0){this.View.ShowMessage("当前没有行被选中!");return;}// 1. 收集所有选中行的单据体主键(FEntryID)var entryIds = selectedRows.Select(item => item.EntryPrimaryKeyValue).ToList();// 2. 构建批量查询SQLvar sql = "SELECT * FROM vw_PUR_Requisition_y WHERE LineNumber IN ({0})";var paramNames = new List<string>();var sqlParams = new List<SqlParam>();for (int i = 0; i < entryIds.Count; i++){var paramName = $"@id{i}";paramNames.Add(paramName);sqlParams.Add(new SqlParam(paramName, KDDbType.Int64, entryIds[i]));}sql = string.Format(sql, string.Join(",", paramNames));// 3. 执行查询var ds = DBUtils.ExecuteDataSet(this.Context, sql, sqlParams);if (ds == null || ds.Tables[0].Rows.Count == 0){this.View.ShowMessage("未查询到选中的数据!");return;}// 4. 转换为DataItem列表List<DataItem> dataItems = new List<DataItem>();foreach (DataRow row in ds.Tables[0].Rows){dataItems.Add(new DataItem{MaterialCode = row["MaterialCode"].ToString(),MaterialName = row["MaterialName"].ToString(),SpecModel = row["SpecModel"].ToString(),Unit = row["Unit"].ToString(),Level1 = row["Level1"].ToString(),PurchaseQuantity = Convert.ToDecimal(row["PurchaseQuantity"]), // 避免直接强制转换失败ArrivalDate = Convert.ToDateTime(row["ArriveDate"]),});}// 5. 调用WebService批量插入string res = BachInsertPendingPurchaseDataClient.BachInsertData(dataItems);this.View.ShowMessage(res);}}}
}

5、在BOS平台新增列表操作按钮、新增绑定列表插件,重启后可在采购申请列表页查看新增的按钮,在列表选中行数据后,点击该按钮即可查看效果。

http://www.dtcms.com/a/613201.html

相关文章:

  • 建设银行理财产品网站网站开发人员需要什么技能
  • 电子商务网站开发背景及意义什么网站可以兼职做设计
  • 简约 个人网站如何做好产品网络推广
  • 手机软件开发和网站开发成都百度推广效果
  • 中卫网站推广营销广州在线网页制作
  • 大连爱得科技网站建设公司怎么样孩子学编程的利弊
  • 企业网站需要注意什么专业网站建设软件开发
  • 广州网站建设公司万齐网络科技商丘网红排行榜
  • 做食品网站需要什么条件住房城乡与建设厅网站首页
  • 旅行网站建设方案策划书东莞寮步做网站的有吗
  • 网站建设部门宣言php网站开发报告
  • 哈尔滨自助建站系统长春做电商网站的公司
  • 做网站要不要35类商标网站构建免费
  • 校园网站的系统建设wordpress如和安装
  • 建设银行网站用户注册不了江宁区建设工程局网站
  • 站长推荐跳转广州社交软件app开发
  • c 网站开发案例wordpress模板是什么意思
  • 网站资料上传教程游戏广告联盟平台
  • 排名好的网站关键词优化企业网站如何做优化推广
  • 还能电子商务网站建设php网站开发编程软件
  • 网站开发有哪几个阶段百度快速收录3元一条
  • 网站免费网站免费优化优化建站之星模板的使用
  • 关于建设殡葬网站的报告范文wordpress开源吗
  • 网站建设成立领导小组许昌网站制作公司
  • 福建建设职业管理中心网站win7优化极致性能
  • 登录建设厅网站的是企业锁吗wordpress第一篇文章id
  • 网站盈利方式天河建网站的公司
  • 郑州 (网站建设宜昌网站建设设计
  • 住房建设厅官方网站html插件代码大全
  • 网站目录命名做营销的网站推广