Public Function SubEDI_FMSQuotation(ByVal G_objService As AWSysBase.SysServer, ByVal strEDI As String, ByVal oResult As EDIResult, ByVal oEDIOpType As Tatium.AWSysPrevlige.SysEDIOpMTType) As Boolean
Try
Dim strErrorMsg As String = ""
Dim oJObject As Newtonsoft.Json.Linq.JObject = Newtonsoft.Json.JsonConvert.DeserializeObject(strEDI)
If oJObject Is Nothing Then
oResult.OK = False
oResult.ErrorMessage = "解析Json错误!"
Return False
End If
Dim strMyUserCode As String = ""
Dim strMyUserPwd As String = ""
Dim QuotationCode As String = ""
Dim oToken As Newtonsoft.Json.Linq.JToken
oToken = oJObject(SubMakeInKeyWord("UserCode"))
If Not oToken Is Nothing Then
strMyUserCode = oToken.ToString()
End If
oToken = oJObject(SubMakeInKeyWord("UserPwd"))
If Not oToken Is Nothing Then
strMyUserPwd = oToken.ToString()
End If
oToken = oJObject(SubMakeInKeyWord("QuotationCode"))
If Not oToken Is Nothing Then
QuotationCode = oToken.ToString()
End If
Dim QuotationCodenum As Integer = QuotationCode.Length
Dim QuotationCod As String = ""
If QuotationCodenum = 11 Then
QuotationCod = "'" & QuotationCode & "'"
Else
Dim num As Integer = 0
While QuotationCodenum > 0 And num < 120
QuotationCod += "'" & QuotationCode.Substring(num, 11) & "'" & ","
num += 12
QuotationCodenum -= 12
End While
QuotationCod = QuotationCod.Substring(0, QuotationCod.Length - 1)
End If
If EDI_FMSCheckUser(strMyUserCode, strMyUserPwd) = False Then
oResult.OK = False
oResult.ErrorMessage = "不是合法ID,不能调用当前接口,请联系供应商确认相关问题!"
Return False
End If
'Dim strSQL As String = "select OfferUsedID from OfferUsed where UsedCode='" & QuotationCode & "'"
'Dim oData As ADODB.Recordset = G_objService.DB_ExecSelectSQLTable(strSQL)
'Dim OfferUse As New AWFMSMain.OfferUsed
'OfferUse.SetService(G_objService)
'If OfferUse.LoadFromDB(G_objService.SB_MyTrim(oData.Fields("OfferUsedID").Value)) = False Then
' oResult.OK = False
' oResult.ErrorMessage = "未能查到相关数据!"
' Return False
'End If
Dim oStringBuilder As New System.Text.StringBuilder()
Dim oStringWriter As New System.IO.StringWriter(oStringBuilder)
'If OfferUse.LoadFromDB(G_objService.SB_MyTrim(oData.Fields("OfferUsedID").Value)) = True Then
Using oJsonWriter As New Newtonsoft.Json.JsonTextWriter(oStringWriter)
oJsonWriter.Formatting = Newtonsoft.Json.Formatting.None
'oJsonWriter.WriteStartArray()
oJsonWriter.WriteStartObject()
oJsonWriter.WritePropertyName("RetStatus")
oJsonWriter.WriteValue("1")
oJsonW