提交测试
This commit is contained in:
@@ -10,6 +10,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Entity
|
|||||||
{
|
{
|
||||||
public bool bSuccess { get; set; }
|
public bool bSuccess { get; set; }
|
||||||
public string message { get; set; }
|
public string message { get; set; }
|
||||||
|
public string voucherCode { get; set; }
|
||||||
|
public string voucherId { get; set; }
|
||||||
public T result { get; set; }
|
public T result { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using log4net;
|
using ADODB;
|
||||||
|
using log4net;
|
||||||
using MSXML2;
|
using MSXML2;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -99,6 +100,47 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var rst = new Recordset();
|
||||||
|
rst.Open($"SELECT CardNumber,BTTblName,BTQName,BWTblName,BWQName,VchListQName,VchTblPrimarykeyNames,ReceiptNOFieldName FROM dbo.vouchers WHERE CardNumber='{cCardNum}'", baseLogin.Connection);
|
||||||
|
|
||||||
|
if (rst.BOF || rst.EOF)
|
||||||
|
{
|
||||||
|
res.bSuccess = false;
|
||||||
|
res.result = $"已在U8生成单据ID为{vouchId}的单据,但是未能查询到该单据的配置信息!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rst.MoveFirst();
|
||||||
|
var fieldName = $"{rst.Fields["VchTblPrimarykeyNames"].Value}";
|
||||||
|
var codeName = $"{rst.Fields["ReceiptNOFieldName"].Value}";
|
||||||
|
if (string.IsNullOrWhiteSpace(fieldName) || string.IsNullOrWhiteSpace(codeName))
|
||||||
|
{
|
||||||
|
res.voucherCode = $"{res.voucherId}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (codeName.Contains("{##}"))
|
||||||
|
{
|
||||||
|
codeName = codeName.Split('{', '#', '#', '}')[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
var strSql = $"SELECT {codeName} AS cCode FROM {rst.Fields["BTTblName"].Value} WHERE {fieldName}='{vouchId}'";
|
||||||
|
rst.Close();
|
||||||
|
|
||||||
|
rst.Open(strSql, baseLogin.Connection);
|
||||||
|
|
||||||
|
if (rst.EOF || rst.BOF)
|
||||||
|
{
|
||||||
|
res.voucherCode = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rst.MoveFirst();
|
||||||
|
res.voucherCode = $"{rst.Fields["cCode"].Value}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res.message = "新增成功";
|
res.message = "新增成功";
|
||||||
res.result = vouchId;
|
res.result = vouchId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user