U811.1接口EAI系列之二-BOM构成-委外BOM构成--VB语言
1.下面代码实现了VB6.0中调用U8EAI-BOM构成服务,以下代码均为项目实际代码,可直接复制应用。
2.在u811.1版本中委外BOM构成与正常的BOM构成是同系列表,不单独存储。
3.是以存货档案中有 委外标识标为是委外件。
4.下面调用的通用方法在: http://www.cnblogs.com/spring_wang/p/3393147.html
作者:王春天 2013-10-28
地址:http://www.cnblogs.com/spring_wang/p/3393359.html
具体代码如下:
一、下面是实际调用的方法,其中一个参数是"Add"与"Edit"是新增构成还是修改构成。那条SQL查询是判断是否有在u8存在构成。
'2.上传u8,如果上传成功再进行更新U8数据表
Dim flag '上传u8 3.先保存u8数据表 Set mrcu8 = U8Query("select * from v_BOM_BomParent where InvCode = '" & U(bpbh) & "'", msgtext) If mrcu8.EOF Then
If Outsourcing_bom(U(bpbh), labBpmc.Caption, FGridArg, "Add") = False Then
MsgBox ("委外构成上传U8出错!")
Exit Sub
End If
Else
If Outsourcing_bom(U(bpbh), labBpmc.Caption, FGridArg, "Edit") = False Then
MsgBox ("委外构成上传U8出错!")
Exit Sub
End If
End If
二、下面是公用调用EAI的BOM构成的方法。
其中更新Inventory存货档案表,是更新委外标识。
'ds_data 数据列 InvCode 子件编码,desl 定额数量
Public Function Outsourcing_bom(as_fjCode As String, as_fjName As String, ds_data As MSHFlexGrid, as_proc As String) As Boolean
'as_proc = "Edit" Outsourcing_bom = False
Dim ls_xml As String
Dim ls_sender As String
Dim ls_data As String
Dim ls_BomId As String
Dim ls_BomType As String
Dim ls_Version As String
Dim ls_VersionDesc As String
Dim ls_VersionEffDate As String
Dim ls_Status As String
Dim ls_VenCode As String
Dim ls_VenDesc As String
Dim ls_InvCode As String
Dim ls_InvName As String
Dim ls_ParentScrap As String
ls_sender = U8_XTM '"001" ls_InvCode = as_fjCode '"WW" '父件编码
ls_InvName = as_fjName '"委外测试" '父件名称 ls_BomType = "" 'BOM类型 不可为空
ls_Version = "" '版本号
ls_VersionDesc = "" '版本描述
ls_Status = "" 'BOM状态
ls_ParentScrap = "" '父件损耗率
ls_BomId = "" 'BOMID 不可为空
ls_VersionEffDate = "2000-01-01T00:00:00+00:00" '版本生效日 '增加文件头相关信息
ls_xml = "<?xml version=""1.0"" encoding=""UTF-8""?>" + vbCrLf ls_xml = ls_xml & "<ufinterface sender=""" & ls_sender & """ receiver=""u8"" roottag=""bom"" docid="""" proc=""" & as_proc & """ renewproofno = ""Y"" codeexchanged=""N"" exportneedexch=""N"" display="""" family="""" timestamp="""">" + vbCrLf
ls_xml = ls_xml & "<Bom>" + vbCrLf '一、增加文件中版本信息 version
ls_xml = ls_xml & "<Version>" + vbCrLf
ls_xml = ls_xml & "<BomId>" & ls_BomId & "</BomId>" + vbCrLf 'BOMID 不可为空
ls_xml = ls_xml & "<BomType>" & ls_BomType & "</BomType>" + vbCrLf 'BOM类型 不可为空
ls_xml = ls_xml & "<Version>" & ls_Version & "</Version>" + vbCrLf '版本号
ls_xml = ls_xml & "<VersionDesc>" & ls_VersionDesc & "</VersionDesc>" + vbCrLf '版本说明
ls_xml = ls_xml & "<VersionEffDate>" & ls_VersionEffDate & "</VersionEffDate>" + vbCrLf '版本生效日
ls_xml = ls_xml & "<IdentCode/>" + vbCrLf
ls_xml = ls_xml & "<IdentDesc/>" + vbCrLf
ls_xml = ls_xml & "<Define1/>" + vbCrLf
ls_xml = ls_xml & "<Define2/>" + vbCrLf
ls_xml = ls_xml & "<Define3/>" + vbCrLf
ls_xml = ls_xml & "<Define4/>" + vbCrLf
ls_xml = ls_xml & "<Define5/>" + vbCrLf
ls_xml = ls_xml & "<Define6/>" + vbCrLf
ls_xml = ls_xml & "<Define7/>" + vbCrLf
ls_xml = ls_xml & "<Define8/>" + vbCrLf
ls_xml = ls_xml & "<Define9/>" + vbCrLf
ls_xml = ls_xml & "<Define10/>" + vbCrLf
ls_xml = ls_xml & "<Define11/>" + vbCrLf
ls_xml = ls_xml & "<Define12/>" + vbCrLf
ls_xml = ls_xml & "<Define13/>" + vbCrLf
ls_xml = ls_xml & "<Define14/>" + vbCrLf
ls_xml = ls_xml & "<Define15/>" + vbCrLf
ls_xml = ls_xml & "<Define16/>" + vbCrLf
ls_xml = ls_xml & "<ApplyCode/>" + vbCrLf
ls_xml = ls_xml & "<ApplySeq/>" + vbCrLf
ls_xml = ls_xml & "<Status>" & ls_Status & "</Status>" + vbCrLf 'BOM状态
ls_xml = ls_xml & "<ModifyTime/>" + vbCrLf
ls_xml = ls_xml & "<CustCode/>" + vbCrLf
ls_xml = ls_xml & "<CustDesc/>" + vbCrLf
ls_xml = ls_xml & "<OrderType/>" + vbCrLf
ls_xml = ls_xml & "<OrderCode/>" + vbCrLf
ls_xml = ls_xml & "<OrderSeq/>" + vbCrLf
ls_xml = ls_xml & "<OrderDId/>" + vbCrLf
ls_xml = ls_xml & "<VenCode>" & ls_VenCode & "</VenCode>" + vbCrLf '供应商编码
ls_xml = ls_xml & "<VenDesc>" & ls_VenDesc & "</VenDesc>" + vbCrLf '供应商名称
Dim ls_ufts As String
ls_ufts = "AAAAAAA6aEU"
ls_xml = ls_xml & "<Ufts>" & ls_ufts & "</Ufts>" + vbCrLf ' '<Ufts>AAAAAAA6aEU=</Ufts>
ls_xml = ls_xml & "</Version>" + vbCrLf '增加文件中父件信息 Parent
ls_xml = ls_xml & "<Parent>" + vbCrLf
ls_xml = ls_xml & "<BomId>" & ls_BomId & "</BomId>" + vbCrLf 'BOMID 不可为空
ls_xml = ls_xml & "<InvCode>" & ls_InvCode & "</InvCode>" + vbCrLf '父件编码
ls_xml = ls_xml & "<InvName>" & ls_InvName & "</InvName>" + vbCrLf '父件名称
ls_xml = ls_xml & "<InvAddCode/>" + vbCrLf
ls_xml = ls_xml & "<Free1/>" + vbCrLf
ls_xml = ls_xml & "<Free2/>" + vbCrLf
ls_xml = ls_xml & "<Free3/>" + vbCrLf
ls_xml = ls_xml & "<Free4/>" + vbCrLf
ls_xml = ls_xml & "<Free5/>" + vbCrLf
ls_xml = ls_xml & "<Free6/>" + vbCrLf
ls_xml = ls_xml & "<Free7/>" + vbCrLf
ls_xml = ls_xml & "<Free8/>" + vbCrLf
ls_xml = ls_xml & "<Free9/>" + vbCrLf
ls_xml = ls_xml & "<Free10/>" + vbCrLf
ls_xml = ls_xml & "<EngineerFigNo/>" + vbCrLf
ls_xml = ls_xml & "<ParentScrap>" & ls_ParentScrap & "</ParentScrap>" + vbCrLf '父件损耗率
ls_xml = ls_xml & "</Parent>" + vbCrLf '二、Component 子件信息
For i = To ds_data.rows - 'ds_data.RecordCount ls_xml = ls_xml & "<Component>" + vbCrLf
' ls_data = "100000000" & Trim(str(i))
ls_data = ""
For j = To - Len(Trim(str(i)))
ls_data = ls_data & ""
Next j
ls_data = ls_data & Trim(str(i)) ls_xml = ls_xml & "<OpComponentId>" & ls_data & "</OpComponentId>" + vbCrLf '子件资料Id
ls_data = ""
ls_xml = ls_xml & "<BomId>" & ls_BomId & "</BomId>" + vbCrLf 'BomId
ls_data = Trim(str(i * ))
ls_xml = ls_xml & "<SortSeq>" & ls_data & "</SortSeq>" + vbCrLf '序号
ls_xml = ls_xml & "<OpSeq>0000</OpSeq>" + vbCrLf '子件编码
' If i = 1 Then
' ls_data = "3910510723"
' Else
' ls_data = "3910510523"
' End If
ls_data = Trim(ds_data.TextMatrix(i, )) ls_xml = ls_xml & "<InvCode>" & ls_data & "</InvCode>" + vbCrLf '子件编码
ls_xml = ls_xml & "<Free1/>" + vbCrLf
ls_xml = ls_xml & "<Free2/>" + vbCrLf
ls_xml = ls_xml & "<Free3/>" + vbCrLf
ls_xml = ls_xml & "<Free4/>" + vbCrLf
ls_xml = ls_xml & "<Free5/>" + vbCrLf
ls_xml = ls_xml & "<Free6/>" + vbCrLf
ls_xml = ls_xml & "<Free7/>" + vbCrLf
ls_xml = ls_xml & "<Free8/>" + vbCrLf
ls_xml = ls_xml & "<Free9/>" + vbCrLf
ls_xml = ls_xml & "<Free10/>" + vbCrLf
ls_xml = ls_xml & "<EngineerFigNo/>" + vbCrLf
ls_data = "2000-01-01T00:00:00+00:00"
ls_xml = ls_xml & "<EffBegDate>" & ls_data & "</EffBegDate>" + vbCrLf '子件生效日期
ls_data = "2099-12-31T00:00:00+00:00"
ls_xml = ls_xml & "<EffEndDate>" & ls_data & "</EffEndDate>" + vbCrLf '子件失效日期
ls_data = ""
ls_xml = ls_xml & "<FVFlag>" & ls_data & "</FVFlag>" + vbCrLf '固定/变动批量(0/1) '子件定额数量
ls_data = Trim(ds_data.TextMatrix(i, )) ls_xml = ls_xml & "<BaseQtyN>" & ls_data & "</BaseQtyN>" + vbCrLf '基本用量-分子
ls_data = ""
ls_xml = ls_xml & "<BaseQtyD>" & ls_data & "</BaseQtyD>" + vbCrLf '基本用量-分母
ls_data = ""
ls_xml = ls_xml & "<CompScrap>" & ls_data & "</CompScrap>" + vbCrLf '子件损耗率
ls_data = "false"
ls_xml = ls_xml & "<ByproductFlag>" & ls_data & "</ByproductFlag>" + vbCrLf '是否联副产品
ls_data = "" & Trim(str(i))
ls_data = ""
For j = To - Len(Trim(str(i)))
ls_data = ls_data & ""
Next j
ls_data = ls_data & Trim(str(i)) ls_xml = ls_xml & "<OptionsId>" & ls_data & "</OptionsId>" + vbCrLf '选项资料Id
ls_xml = ls_xml & "<AuxUnitCode/>" + vbCrLf
ls_xml = ls_xml & "<ChangeRate/>" + vbCrLf
ls_xml = ls_xml & "<AuxBaseQtyN/>" + vbCrLf
ls_data = ""
ls_xml = ls_xml & "<ProductType>" & ls_data & "</ProductType>" + vbCrLf '
ls_xml = ls_xml & "<Define22/>" + vbCrLf
ls_xml = ls_xml & "<Define23/>" + vbCrLf
ls_xml = ls_xml & "<Define24/>" + vbCrLf
ls_xml = ls_xml & "<Define25/>" + vbCrLf
ls_xml = ls_xml & "<Define26/>" + vbCrLf
ls_xml = ls_xml & "<Define27/>" + vbCrLf
ls_xml = ls_xml & "<Define28/>" + vbCrLf
ls_xml = ls_xml & "<Define29/>" + vbCrLf
ls_xml = ls_xml & "<Define30/>" + vbCrLf
ls_xml = ls_xml & "<Define31/>" + vbCrLf
ls_xml = ls_xml & "<Define32/>" + vbCrLf
ls_xml = ls_xml & "<Define33/>" + vbCrLf
ls_xml = ls_xml & "<Define34/>" + vbCrLf
ls_xml = ls_xml & "<Define35/>" + vbCrLf
ls_xml = ls_xml & "<Define36/>" + vbCrLf
ls_xml = ls_xml & "<Define37/>" + vbCrLf
ls_xml = ls_xml & "<Remark/>" + vbCrLf ls_xml = ls_xml & "</Component>" + vbCrLf
Next i '三、ComponentOpt 子件其它信息
For i = To ds_data.rows - 'ds_data.RecordCount
ls_xml = ls_xml & "<ComponentOpt>" + vbCrLf
' ls_data = "100000000" & Trim(str(i))
ls_data = ""
For j = To - Len(Trim(str(i)))
ls_data = ls_data & ""
Next j
ls_data = ls_data & Trim(str(i)) ls_xml = ls_xml & "<OptionsId>" & ls_data & "</OptionsId>" + vbCrLf '选项资料Id
ls_xml = ls_xml & "<Offset>0</Offset>" + vbCrLf
ls_data = ""
ls_xml = ls_xml & "<WIPType>" & ls_data & "</WIPType>" + vbCrLf 'WIP属性(1入库/2工序/3领料/4虚拟)
ls_data = "true"
ls_xml = ls_xml & "<AccuCostFlag>" & ls_data & "</AccuCostFlag>" + vbCrLf '是/否累计成本
ls_xml = ls_xml & "<DrawDeptCode/>" + vbCrLf
ls_xml = ls_xml & "<Whcode/>" + vbCrLf
ls_data = "false"
ls_xml = ls_xml & "<OptionalFlag>" & ls_data & "</OptionalFlag>" + vbCrLf '是否可选
ls_data = ""
ls_xml = ls_xml & "<MutexRule>" & ls_data & "</MutexRule>" + vbCrLf '互斥原则(1-ONE/2-ALL/3-ANY/4-AL0)
ls_data = ""
ls_xml = ls_xml & "<PlanFactor>" & ls_data & "</PlanFactor>" + vbCrLf '计划比例
ls_data = "false"
ls_xml = ls_xml & "<CostWIPRel>" & ls_data & "</CostWIPRel>" + vbCrLf '固定/变动批量(0/1)
ls_data = ""
ls_xml = ls_xml & "<Offset>" & ls_data & "</Offset>" + vbCrLf '偏置期
ls_xml = ls_xml & "</ComponentOpt>" + vbCrLf
Next i '增加文件尾相关信息
ls_xml = ls_xml & "</Bom>" + vbCrLf
ls_xml = ls_xml & "</ufinterface>" + vbCrLf Dim xml_document As New DOMDocument
xml_document.loadXML (ls_xml)
fn2 = App.Path & "\u8_code2.xml"
xml_document.save (fn2) Dim ls_temp As String '接收返回消息,如果成功,返回U8中物料代码,如果失败,返回错误信息
If SendToEAI(ls_xml, ls_temp) Then '成功
' MsgBox "上传成功" & ls_temp Dim sqls() As String
Dim sqls_range
Dim msgtext As String sqls_range =
ReDim Preserve sqls(sqls_range)
sqls(sqls_range) = "update Inventory set bProxyForeign = 1 where cInvCode = '" & as_fjCode & "' " If U8Update(sqls, msgtext) = False Then
'数据库更新失败退出
MsgBox msgtext
Outsourcing_bom = False
Else
Outsourcing_bom = True
End If Else '失败
MsgBox ls_temp
Outsourcing_bom = False
End If End Function
U811.1接口EAI系列之二-BOM构成-委外BOM构成--VB语言的更多相关文章
- U811.1接口EAI系列之二--生成销售出库单调用U8的EAI通用处理方法--PowerBuilder语言
1.销售系统销售出库,更新U811.1材料库存的EAI的XML生成. 2.主要根据U8配置会生成出库单和同时是否更新库存量,还是更新现存量等等. 3.具体参考代码如下: 作者:王春天 2013-11- ...
- U811.1接口EAI系列之六--物料上传--VB语言
1. 业务系统同步U811.1存货档案通用方法. 2.具体代码处理如下: 作者:王春天 2013-11-06 地址:http://www.cnblogs.com/spring_wang/p/34098 ...
- U811.1接口EAI系列之四--委外订单生成--VB语言
委外订单主细表.子个构成需求.具体代码与参数说明. 下面调用的通用方法在: http://www.cnblogs.com/spring_wang/p/3393147.html 作者:王春天 2013- ...
- U811.1接口EAI系列之一-通用访问EAI方法--统一调用EAI公共方法--VB语言
1.现在做的项目是关于业务系统与U811.1的接口项目. 2.那么就需要调整通过EAI调用生成U8业务单据. 3.下面就一个通用的向U8-EAI传递XML的通用方法 4.肯定有人会问怎么还用VB调用呢 ...
- U811.1接口EAI系列之一--通用把XML传送给EAI处理方法--PowerBuilder语言
1.前面配置参考:http://www.cnblogs.com/spring_wang/p/3393147.html 2.pb通用调EAI方法代码如下: //===================== ...
- U811.1接口EAI系列之五--材料出库--VB语言
主要业务有:09其他出库单 11:材料出库单 32:销售出库单 主要业务代码: '材料出库生成XML Public Function xml_storeout(ds_head As MSHFlexGr ...
- U811.1接口EAI系列之三--采购订单生成--VB语言
采购订单业务,下面是具体代码与参数说明: 下面调用的通用方法在: http://www.cnblogs.com/spring_wang/p/3393147.html 作者:王春天 2013-10-31 ...
- 【MM系列】SAP MM模块-委外采购订单 把Warning转换成Error信息提示
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP MM模块-委外采购订单 把W ...
- C#微信公众号开发系列教程二(新手接入指南)
http://www.cnblogs.com/zskbll/p/4093954.html 此系列前面已经更新了两篇博文了,都是微信开发的前期准备工作,现在切入正题,本篇讲解新手接入的步骤与方法,大神可 ...
随机推荐
- 查看JAVA的class二进制文件的方法
hexdump -C filename可以查看二进制文件. 比如java的Test.java public class Test{ public static void main(String[] a ...
- WIP 004 - Quote/Policy Search
Please create the search form Auto complete for first name and last name Related tables System_LOBs ...
- 算法笔记_199:第二届蓝桥杯软件类决赛真题(C语言本科)
前言:以下代码部分仅供参考,C语言解答部分全部来自网友,Java语言部分部分参考自网友,对于答案的正确性不能完全保证. 试题1 数论中有著名的四方定理:所有自然数至多只要用四个数的平方和就可以表示. ...
- Linux下使用logrotate实现日志切换
运维过程中经常会发现一些 C 程序,每天会生产这样的日志: /home/admin/app_name/logs/access_log 那么天长地久,如果这个程序不会自动去轮转这个日志,那么这个日志文件 ...
- 关于CBC for ios 加密要记
倒腾了接近半天,资料找了无数,最后是通过查看Android项目中的加密工具类,才弄明白,在这过程中掌握了一些知识点.比如: 问题1:关于PKCS7Padding和PKCS5Padding iOS中AE ...
- JS或AS中处理ARGB、RGBA颜色值时要小心
(0xffffffff)>>24; //-1 (0xffffffff / 2)>>23; argb颜色需要一个无符号整数uint才能存储,如果首位是F,那么第一个二进制位就是1 ...
- Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition
Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) 最近因需要在Oracle 数据库上建立ODI的资料档案库,需要安装Oracle Database ...
- 创建第一个servlet程序--HelloServlet
这篇文章是用来纪念我第一次创建一个Servlet程序,步骤我会写得详细点,也可以参考一下,后续我会将SpringMVC 跟ssh的搭建分别更新(ps:不忙的话我会更新) 工具:java jdk 1.6 ...
- Spring Cloud Dalston.SR5 BUG一记
使用Dalston.SR5版本的Zuul时, 发现Ribbon重试不能切换服务实例, 换成Edgware.SR3,同样的配置可以切换实例进行重试 还有个不升级所有Spring Cloud组件的方法,仅 ...
- 微信小程序学习点滴《十二》:图片等比例缩放 获取屏幕尺寸图片尺寸 自适应
原文:http://www.wxapp-union.com/portal.php?mod=view&aid=360 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于屏 ...