Commit 99fb8834e68a4798ff0aed730ee1490f669d8f37
1 parent
b9cc1381
修改
Showing
3 changed files
with
168 additions
and
170 deletions
WebApp/Apps/api/IStackerStatusApp.cs
@@ -1673,146 +1673,146 @@ namespace WebApp | @@ -1673,146 +1673,146 @@ namespace WebApp | ||
1673 | } | 1673 | } |
1674 | } | 1674 | } |
1675 | //入库完成测试接口 | 1675 | //入库完成测试接口 |
1676 | - if (sTKStatusModel.Status == 90) | ||
1677 | - { | ||
1678 | - //测试调用ERP接口 | ||
1679 | - TIPTOPServiceGateWayPortTypeClient TipOut = new TIPTOPServiceGateWayPortTypeClient(); | ||
1680 | - ConfigXmlDocument doc = new ConfigXmlDocument(); | ||
1681 | - //读取传入的xml | ||
1682 | - var config = AppSettingsJson.GetAppSettings(); | ||
1683 | - doc.Load(config.GetSection("NouYaWebInBackService:Url").Value); | ||
1684 | - //将物料号填入 | ||
1685 | - XmlNodeList ns = doc.SelectNodes("//Field"); | ||
1686 | - foreach (XmlElement node in ns) | ||
1687 | - { | ||
1688 | - //作业类型 | ||
1689 | - if (node.GetAttribute("name") == "tc_dcf001") | ||
1690 | - { | ||
1691 | - node.SetAttribute("value", "D111"); | ||
1692 | - } | ||
1693 | - //入库单号 | ||
1694 | - else if (node.GetAttribute("name") == "tc_dcf003") | ||
1695 | - { | ||
1696 | - node.SetAttribute("value", "123123"); | ||
1697 | - } | ||
1698 | - //客商编号 | ||
1699 | - else if (node.GetAttribute("name") == "tc_dcf004") | ||
1700 | - { | ||
1701 | - node.SetAttribute("value", "123"); | ||
1702 | - } | ||
1703 | - //入库日期 | ||
1704 | - else if (node.GetAttribute("name") == "tc_dcf005") | ||
1705 | - { | ||
1706 | - node.SetAttribute("value", "2020-11-20"); | ||
1707 | - } | ||
1708 | - //入库部门 | ||
1709 | - else if (node.GetAttribute("name") == "tc_dcf006") | ||
1710 | - { | ||
1711 | - node.SetAttribute("value", "123"); | ||
1712 | - } | ||
1713 | - //单据状态 | ||
1714 | - else if (node.GetAttribute("name") == "tc_dcf012") | ||
1715 | - { | ||
1716 | - node.SetAttribute("value", "123"); | ||
1717 | - } | ||
1718 | - //营运中心 | ||
1719 | - else if (node.GetAttribute("name") == "tc_dcf013") | ||
1720 | - { | ||
1721 | - node.SetAttribute("value", "123"); | ||
1722 | - } | ||
1723 | - //单据项次 | ||
1724 | - else if (node.GetAttribute("name") == "tc_dcf015") | ||
1725 | - { | ||
1726 | - node.SetAttribute("value", "123"); | ||
1727 | - } | ||
1728 | - //物料编号 | ||
1729 | - else if (node.GetAttribute("name") == "tc_dcf016") | ||
1730 | - { | ||
1731 | - node.SetAttribute("value", "7120004938"); | ||
1732 | - } | ||
1733 | - //单位 | ||
1734 | - else if (node.GetAttribute("name") == "tc_dcf019") | ||
1735 | - { | ||
1736 | - node.SetAttribute("value", "7120004938"); | ||
1737 | - } | ||
1738 | - //申请数量 | ||
1739 | - else if (node.GetAttribute("name") == "tc_dcf021") | ||
1740 | - { | ||
1741 | - node.SetAttribute("value", "100"); | ||
1742 | - } | ||
1743 | - //实际数量 | ||
1744 | - else if (node.GetAttribute("name") == "tc_dcf022") | ||
1745 | - { | ||
1746 | - node.SetAttribute("value", "100"); | ||
1747 | - } | ||
1748 | - //单据完成状态 | ||
1749 | - else if (node.GetAttribute("name") == "tc_dcf023") | ||
1750 | - { | ||
1751 | - node.SetAttribute("value", "1"); | ||
1752 | - } | ||
1753 | - //单据完成结果 | ||
1754 | - else if (node.GetAttribute("name") == "tc_dcf024") | ||
1755 | - { | ||
1756 | - node.SetAttribute("value", ""); | ||
1757 | - } | ||
1758 | - //仓库 | ||
1759 | - else if (node.GetAttribute("name") == "tc_dcf028") | ||
1760 | - { | ||
1761 | - node.SetAttribute("value", "B0010"); | ||
1762 | - } | ||
1763 | - //WMS回传仓库 | ||
1764 | - else if (node.GetAttribute("name") == "tc_dcf029") | ||
1765 | - { | ||
1766 | - node.SetAttribute("value", "B0010"); | ||
1767 | - } | ||
1768 | - //库位 | ||
1769 | - else if (node.GetAttribute("name") == "tc_dcf030") | ||
1770 | - { | ||
1771 | - node.SetAttribute("value", ""); | ||
1772 | - } | ||
1773 | - //WMS回传库位 | ||
1774 | - else if (node.GetAttribute("name") == "tc_dcf031") | ||
1775 | - { | ||
1776 | - node.SetAttribute("value", "CA-01-05"); | ||
1777 | - } | ||
1778 | - //批号 | ||
1779 | - else if (node.GetAttribute("name") == "tc_dcf032") | ||
1780 | - { | ||
1781 | - node.SetAttribute("value", "20201120001"); | ||
1782 | - } | ||
1783 | - //工单号 | ||
1784 | - else if (node.GetAttribute("name") == "tc_dcf033") | ||
1785 | - { | ||
1786 | - node.SetAttribute("value", "123"); | ||
1787 | - } | 1676 | + //if (sTKStatusModel.Status == 90) |
1677 | + //{ | ||
1678 | + // //测试调用ERP接口 | ||
1679 | + // TIPTOPServiceGateWayPortTypeClient TipIn = new TIPTOPServiceGateWayPortTypeClient(); | ||
1680 | + // ConfigXmlDocument doc = new ConfigXmlDocument(); | ||
1681 | + // //读取传入的xml | ||
1682 | + // var config = AppSettingsJson.GetAppSettings(); | ||
1683 | + // doc.Load(config.GetSection("NouYaWebInBackService:Url").Value); | ||
1684 | + // //将物料号填入 | ||
1685 | + // XmlNodeList ns = doc.SelectNodes("//Field"); | ||
1686 | + // foreach (XmlElement node in ns) | ||
1687 | + // { | ||
1688 | + // //作业类型 | ||
1689 | + // if (node.GetAttribute("name") == "tc_dcf001") | ||
1690 | + // { | ||
1691 | + // node.SetAttribute("value", "D111"); | ||
1692 | + // } | ||
1693 | + // //入库单号 | ||
1694 | + // else if (node.GetAttribute("name") == "tc_dcf003") | ||
1695 | + // { | ||
1696 | + // node.SetAttribute("value", "123123"); | ||
1697 | + // } | ||
1698 | + // //客商编号 | ||
1699 | + // else if (node.GetAttribute("name") == "tc_dcf004") | ||
1700 | + // { | ||
1701 | + // node.SetAttribute("value", "123"); | ||
1702 | + // } | ||
1703 | + // //入库日期 | ||
1704 | + // else if (node.GetAttribute("name") == "tc_dcf005") | ||
1705 | + // { | ||
1706 | + // node.SetAttribute("value", "2020-11-20"); | ||
1707 | + // } | ||
1708 | + // //入库部门 | ||
1709 | + // else if (node.GetAttribute("name") == "tc_dcf006") | ||
1710 | + // { | ||
1711 | + // node.SetAttribute("value", "123"); | ||
1712 | + // } | ||
1713 | + // //单据状态 | ||
1714 | + // else if (node.GetAttribute("name") == "tc_dcf012") | ||
1715 | + // { | ||
1716 | + // node.SetAttribute("value", "123"); | ||
1717 | + // } | ||
1718 | + // //营运中心 | ||
1719 | + // else if (node.GetAttribute("name") == "tc_dcf013") | ||
1720 | + // { | ||
1721 | + // node.SetAttribute("value", "123"); | ||
1722 | + // } | ||
1723 | + // //单据项次 | ||
1724 | + // else if (node.GetAttribute("name") == "tc_dcf015") | ||
1725 | + // { | ||
1726 | + // node.SetAttribute("value", "123"); | ||
1727 | + // } | ||
1728 | + // //物料编号 | ||
1729 | + // else if (node.GetAttribute("name") == "tc_dcf016") | ||
1730 | + // { | ||
1731 | + // node.SetAttribute("value", "7120004938"); | ||
1732 | + // } | ||
1733 | + // //单位 | ||
1734 | + // else if (node.GetAttribute("name") == "tc_dcf019") | ||
1735 | + // { | ||
1736 | + // node.SetAttribute("value", "7120004938"); | ||
1737 | + // } | ||
1738 | + // //申请数量 | ||
1739 | + // else if (node.GetAttribute("name") == "tc_dcf021") | ||
1740 | + // { | ||
1741 | + // node.SetAttribute("value", "100"); | ||
1742 | + // } | ||
1743 | + // //实际数量 | ||
1744 | + // else if (node.GetAttribute("name") == "tc_dcf022") | ||
1745 | + // { | ||
1746 | + // node.SetAttribute("value", "100"); | ||
1747 | + // } | ||
1748 | + // //单据完成状态 | ||
1749 | + // else if (node.GetAttribute("name") == "tc_dcf023") | ||
1750 | + // { | ||
1751 | + // node.SetAttribute("value", "1"); | ||
1752 | + // } | ||
1753 | + // //单据完成结果 | ||
1754 | + // else if (node.GetAttribute("name") == "tc_dcf024") | ||
1755 | + // { | ||
1756 | + // node.SetAttribute("value", ""); | ||
1757 | + // } | ||
1758 | + // //仓库 | ||
1759 | + // else if (node.GetAttribute("name") == "tc_dcf028") | ||
1760 | + // { | ||
1761 | + // node.SetAttribute("value", "B0010"); | ||
1762 | + // } | ||
1763 | + // //WMS回传仓库 | ||
1764 | + // else if (node.GetAttribute("name") == "tc_dcf029") | ||
1765 | + // { | ||
1766 | + // node.SetAttribute("value", "B0010"); | ||
1767 | + // } | ||
1768 | + // //库位 | ||
1769 | + // else if (node.GetAttribute("name") == "tc_dcf030") | ||
1770 | + // { | ||
1771 | + // node.SetAttribute("value", ""); | ||
1772 | + // } | ||
1773 | + // //WMS回传库位 | ||
1774 | + // else if (node.GetAttribute("name") == "tc_dcf031") | ||
1775 | + // { | ||
1776 | + // node.SetAttribute("value", "CA-01-05"); | ||
1777 | + // } | ||
1778 | + // //批号 | ||
1779 | + // else if (node.GetAttribute("name") == "tc_dcf032") | ||
1780 | + // { | ||
1781 | + // node.SetAttribute("value", "20201120001"); | ||
1782 | + // } | ||
1783 | + // //工单号 | ||
1784 | + // else if (node.GetAttribute("name") == "tc_dcf033") | ||
1785 | + // { | ||
1786 | + // node.SetAttribute("value", "123"); | ||
1787 | + // } | ||
1788 | 1788 | ||
1789 | - } | ||
1790 | - //调用方法 | ||
1791 | - var response = TipOut.intostore_post(doc.InnerXml); | ||
1792 | - //处理调用后回传数据 | ||
1793 | - doc.LoadXml(response); | ||
1794 | - //接口记录 | ||
1795 | - InterfaceLog inter = new InterfaceLog(); | ||
1796 | - inter.Initiator = "WMS"; | ||
1797 | - inter.recipient = "ERP"; | ||
1798 | - inter.Request = doc.InnerXml; | ||
1799 | - inter.Method = "LK_InBack"; | ||
1800 | - inter.CreateTime = DateTime.Now; | ||
1801 | - inter.CreateBy = "WMS"; | ||
1802 | - _unitWork.Add(inter); | ||
1803 | - | ||
1804 | - XmlElement element = (XmlElement)doc.SelectSingleNode("//Status"); | ||
1805 | - string code = element.GetAttribute("code"); | ||
1806 | - if (code == "0") | ||
1807 | - { | ||
1808 | - return "调用接口成功"; | ||
1809 | - } | ||
1810 | - else | ||
1811 | - { | ||
1812 | - string description = element.GetAttribute("description"); | ||
1813 | - return description; | ||
1814 | - } | ||
1815 | - } | 1789 | + // } |
1790 | + // //调用方法 | ||
1791 | + // var response = TipIn.intostore_post(doc.InnerXml); | ||
1792 | + // //处理调用后回传数据 | ||
1793 | + // doc.LoadXml(response); | ||
1794 | + // //接口记录 | ||
1795 | + // InterfaceLog inter = new InterfaceLog(); | ||
1796 | + // inter.Initiator = "WMS"; | ||
1797 | + // inter.recipient = "ERP"; | ||
1798 | + // inter.Request = doc.InnerXml; | ||
1799 | + // inter.Method = "LK_InBack"; | ||
1800 | + // inter.CreateTime = DateTime.Now; | ||
1801 | + // inter.CreateBy = "WMS"; | ||
1802 | + // _unitWork.Add(inter); | ||
1803 | + | ||
1804 | + // XmlElement element = (XmlElement)doc.SelectSingleNode("//Status"); | ||
1805 | + // string code = element.GetAttribute("code"); | ||
1806 | + // if (code == "0") | ||
1807 | + // { | ||
1808 | + // return "调用接口成功"; | ||
1809 | + // } | ||
1810 | + // else | ||
1811 | + // { | ||
1812 | + // string description = element.GetAttribute("description"); | ||
1813 | + // return description; | ||
1814 | + // } | ||
1815 | + //} | ||
1816 | 1816 | ||
1817 | } | 1817 | } |
1818 | else | 1818 | else |
WebMvc/Areas/WebService/SampleService.cs
@@ -90,25 +90,38 @@ namespace WebMvc.Areas.WebService | @@ -90,25 +90,38 @@ namespace WebMvc.Areas.WebService | ||
90 | doc.LoadXml(Request); | 90 | doc.LoadXml(Request); |
91 | string name = ""; | 91 | string name = ""; |
92 | string value = ""; | 92 | string value = ""; |
93 | + string UpperTaskNo = ""; | ||
93 | string SourceCode = ""; | 94 | string SourceCode = ""; |
95 | + string TaskType = ""; | ||
96 | + string CustomerCode = ""; | ||
94 | string MaterialCode = ""; | 97 | string MaterialCode = ""; |
95 | string SupplierCode = ""; | 98 | string SupplierCode = ""; |
96 | decimal? Num = 0; | 99 | decimal? Num = 0; |
97 | string WareCell = ""; | 100 | string WareCell = ""; |
98 | string Code = ""; | 101 | string Code = ""; |
99 | var NewCode = ""; | 102 | var NewCode = ""; |
100 | - XmlNodeList RecordSets = doc.SelectNodes("//RecordSet"); | 103 | + XmlNodeList RecordSets = doc.SelectNodes("//Record"); |
101 | foreach (XmlNode RecordSet in RecordSets) | 104 | foreach (XmlNode RecordSet in RecordSets) |
102 | { | 105 | { |
103 | - XmlNodeList nodes = RecordSet.SelectNodes("//Field"); | 106 | + XmlNodeList nodes = RecordSet.ChildNodes; |
104 | foreach (XmlElement node in nodes) | 107 | foreach (XmlElement node in nodes) |
105 | { | 108 | { |
106 | //抓取单个的xml节点 | 109 | //抓取单个的xml节点 |
107 | //获得字节里面的属性值 | 110 | //获得字节里面的属性值 |
108 | name = node.GetAttribute("name"); | 111 | name = node.GetAttribute("name"); |
109 | value = node.GetAttribute("value"); | 112 | value = node.GetAttribute("value"); |
113 | + //上游任务号 | ||
114 | + if (name == "tc_dcf000" && !string.IsNullOrEmpty(value)) | ||
115 | + { | ||
116 | + UpperTaskNo = value; | ||
117 | + } | ||
118 | + //上游作业类型 | ||
119 | + else if (name == "tc_dcf001" && !string.IsNullOrEmpty(value)) | ||
120 | + { | ||
121 | + TaskType = value; | ||
122 | + } | ||
110 | //上游系统单号 | 123 | //上游系统单号 |
111 | - if (name == "tc_dcf003" && !string.IsNullOrEmpty(value)) | 124 | + else if (name == "tc_dcf003" && !string.IsNullOrEmpty(value)) |
112 | { | 125 | { |
113 | SourceCode = value; | 126 | SourceCode = value; |
114 | } | 127 | } |
WebRepository/Domain/monitor/InterfaceLog.cs
@@ -14,44 +14,29 @@ namespace WebRepository | @@ -14,44 +14,29 @@ namespace WebRepository | ||
14 | } | 14 | } |
15 | 15 | ||
16 | /// <summary> | 16 | /// <summary> |
17 | - /// 接口类型:发送/接收 | 17 | + /// 状态 |
18 | /// </summary> | 18 | /// </summary> |
19 | - [Column("type")] | ||
20 | - public string Type { get; set; } | 19 | + [Column("status")] |
20 | + public string Status { get; set; } | ||
21 | /// <summary> | 21 | /// <summary> |
22 | - /// 发起者 | 22 | + /// 唯一标识(上游任务号加上游系统单号) |
23 | /// </summary> | 23 | /// </summary> |
24 | - [Column("Initiator")] | ||
25 | - public string Initiator { get; set; } | 24 | + [Column("taskNo")] |
25 | + public string TaskNo { get; set; } | ||
26 | /// <summary> | 26 | /// <summary> |
27 | - ///接收者 | 27 | + ///任务总条数 |
28 | /// </summary> | 28 | /// </summary> |
29 | - [Column("recipient")] | ||
30 | - public string recipient { get; set; } | 29 | + [Column("allNum")] |
30 | + public string AllNum { get; set; } | ||
31 | /// <summary> | 31 | /// <summary> |
32 | - /// 方法 | 32 | + /// 完成总条数 |
33 | /// </summary> | 33 | /// </summary> |
34 | - [Column("method")] | ||
35 | - public string Method { get; set; } | 34 | + [Column("comNum")] |
35 | + public string ComNum { get; set; } | ||
36 | /// <summary> | 36 | /// <summary> |
37 | - /// 请求 | 37 | + /// 数据 |
38 | /// </summary> | 38 | /// </summary> |
39 | [Column("request")] | 39 | [Column("request")] |
40 | public string Request { get; set; } | 40 | public string Request { get; set; } |
41 | - /// <summary> | ||
42 | - /// 响应 | ||
43 | - /// </summary> | ||
44 | - [Column("response")] | ||
45 | - public string Response { get; set; } | ||
46 | - /// <summary> | ||
47 | - /// 结果 | ||
48 | - /// </summary> | ||
49 | - [Column("result")] | ||
50 | - public string Result { get; set; } | ||
51 | - /// <summary> | ||
52 | - /// 日志时间 | ||
53 | - /// </summary> | ||
54 | - [Column("logtime")] | ||
55 | - public System.DateTime? Logtime { get; set; } | ||
56 | } | 41 | } |
57 | } | 42 | } |
58 | \ No newline at end of file | 43 | \ No newline at end of file |