增加交易唯一码,方便在网络状态不佳的情况下重新获取操作结果
This commit is contained in:
@@ -24,7 +24,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
/// </summary>
|
||||
public class USERPCO
|
||||
{
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("_logInfo");
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 新增单据
|
||||
@@ -171,13 +171,14 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
throw new Exception("审核单据时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"当前单据号:{res.voucherCode},操作完成,操作结果:成功!------[{vouchId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
_logInfo.Debug($"当前单据号:{res.voucherCode},操作完成,操作结果:成功!------[{vouchId}]------[{errorMsg}]------[{bVerify}]------[{cCardNum}]------[{domMsg.xml}]");
|
||||
|
||||
|
||||
if (bVerify && cCardNum=="0304")
|
||||
{
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},开始审核其他出入库单据");
|
||||
|
||||
var strSql = $"select ID,cCode from RdRecord09 where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='调拨' and cBusCode='{res.voucherCode}'";
|
||||
var strSql = $"select ID,cCode,ufts from KCOtherOutH where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='调拨' and cBusCode='{res.voucherCode}'";
|
||||
|
||||
var rst = new Recordset();
|
||||
|
||||
@@ -187,13 +188,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
{
|
||||
var outId = $"{rst.Fields["ID"].Value}";
|
||||
var outCode = $"{rst.Fields["cCode"].Value}";
|
||||
var ufts = $"{rst.Fields["ufts"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
errorMsg = "";
|
||||
domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他出库单:{outCode},开始审核其他出库单");
|
||||
|
||||
var resOut = co.Verify("09", outId, ref errorMsg, baseLogin.Connection, null, ref domMsg);
|
||||
var resOut = co.Verify("09", outId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resOut)
|
||||
{
|
||||
@@ -208,10 +212,12 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他出库单:{outCode},审核其他出库单完成,操作结果:成功!------[{outId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
rst.Close();
|
||||
}
|
||||
|
||||
rst.Close();
|
||||
|
||||
strSql = $"select ID,cCode from RdRecord08 where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='调拨' and cBusCode='{res.voucherCode}'";
|
||||
strSql = $"select ID,cCode,ufts from KCOtherInH where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='调拨' and cBusCode='{res.voucherCode}'";
|
||||
|
||||
var rst2 = new Recordset();
|
||||
|
||||
@@ -221,13 +227,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
{
|
||||
var inId = $"{rst2.Fields["ID"].Value}";
|
||||
var inCode = $"{rst2.Fields["cCode"].Value}";
|
||||
var ufts = $"{rst2.Fields["ufts"].Value}";
|
||||
|
||||
rst2.Close();
|
||||
|
||||
errorMsg = "";
|
||||
domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他入库单:{inId},开始审核其他入库单");
|
||||
|
||||
var resIn = co.Verify("08", inId, ref errorMsg, baseLogin.Connection, null, ref domMsg);
|
||||
var resIn = co.Verify("08", inId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resIn)
|
||||
{
|
||||
@@ -242,10 +251,68 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他入库单:{inCode},审核其他入库单完成,操作结果:成功!------[{inId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
}
|
||||
|
||||
rst2.Close();
|
||||
else
|
||||
{
|
||||
rst2.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(bVerify && cCardNum == "0411")
|
||||
{
|
||||
_logInfo.Debug($"0411,当前单据号:{res.voucherCode},开始审核材料出库单");
|
||||
|
||||
var strSql = $"select ID,cCode,ufts from RecordOutQ where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='产成品入库单' and cBusCode='{res.voucherCode}'";
|
||||
|
||||
var rst = new Recordset();
|
||||
|
||||
rst.Open(strSql, baseLogin.Connection);
|
||||
|
||||
if (!rst.BOF && !rst.EOF)
|
||||
{
|
||||
var outId = $"{rst.Fields["ID"].Value}";
|
||||
var outCode = $"{rst.Fields["cCode"].Value}";
|
||||
var ufts = $"{rst.Fields["ufts"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
errorMsg = "";
|
||||
domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"0411,当前单据号:{res.voucherCode},材料出库单:{outCode},开始审核材料出库单");
|
||||
|
||||
var resOut = co.Verify("11", outId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resOut)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
_logInfo.Error($"第1次审核出错,错误信息:{errorMsg}");
|
||||
|
||||
resOut = co.Verify("11", outId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resOut)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
throw new Exception($"审核材料出库单时发生异常,错误信息:{errorMsg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(domMsg.xml))
|
||||
throw new Exception($"审核材料出库单时发生异常,零出库控制:{domMsg.xml}");
|
||||
|
||||
throw new Exception("审核材料出库单时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"0411,当前单据号:{res.voucherCode},材料出库单:{outCode},审核材料出库单完成,操作结果:成功!------[{outId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
rst.Close();
|
||||
}
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// var strSql = $"UPDATE {vouchers.cBTTblName} SET cHandler = '{dictionary["cmaker"]}' WHERE {vouchers.voucherIdFieldName}={vouchId}";
|
||||
@@ -480,6 +547,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Verify(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -557,6 +626,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Verify(co, conn, sVouchType, cCode, vouchId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -965,6 +1036,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await UnVerify(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
return verifyResult;
|
||||
@@ -1033,6 +1106,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await UnVerify(co, conn, sVouchType, cCode, vouchId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
return verifyResult;
|
||||
@@ -1165,6 +1240,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Delete(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -1242,6 +1319,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Delete(co, conn, sVouchType, cCode, vouchId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -1312,6 +1391,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Delete(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
return verifyResult;
|
||||
|
||||
Reference in New Issue
Block a user