修复销售订单查询报错的问题
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using log4net;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UFIDA.U8.Audit.ServiceProxy;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
@@ -58,14 +59,26 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Workflow
|
||||
{
|
||||
var auditServiceProxy = new AuditServiceProxy();
|
||||
|
||||
var isWfControled = false;
|
||||
var isWfControled = IsFlowEnabled(login, bizObjectId, eventId);
|
||||
var errMsg = "";
|
||||
|
||||
var res = auditServiceProxy.SubmitApplicationMessage(bizObjectId, eventId, voucherId, login._productContext.calledContext, ref isWfControled, ref errMsg);
|
||||
|
||||
if (!res && !string.IsNullOrWhiteSpace(errMsg))
|
||||
if (isWfControled)
|
||||
{
|
||||
throw new Exception(errMsg);
|
||||
var context = new CalledContext() { subId = "PU", token = login.userToken };
|
||||
|
||||
var res = auditServiceProxy.SubmitApplicationMessage(bizObjectId, eventId, voucherId, context,
|
||||
ref isWfControled, ref errMsg);
|
||||
|
||||
if (!res && !string.IsNullOrWhiteSpace(errMsg))
|
||||
{
|
||||
throw new Exception(errMsg);
|
||||
}
|
||||
|
||||
if (!res)
|
||||
{
|
||||
throw new Exception("审批流发生异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!isWfControled && !string.IsNullOrWhiteSpace(errMsg))
|
||||
@@ -78,12 +91,6 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Workflow
|
||||
throw new Exception("当前单据无法进入工作流");
|
||||
}
|
||||
|
||||
if (!res)
|
||||
{
|
||||
throw new Exception("审批流发生异常");
|
||||
}
|
||||
|
||||
|
||||
return new BaseResult<string>
|
||||
{
|
||||
bSuccess = true,
|
||||
@@ -505,6 +512,98 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Workflow
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// #提交审批流#
|
||||
/// </summary>
|
||||
/// <param name="login"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="voucherCode"></param>
|
||||
/// <param name="bUAP"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessage(BaseLogin login, string cCardNum, string voucherCode, bool bUAP = false)
|
||||
{
|
||||
var voucherId = "";
|
||||
|
||||
try
|
||||
{
|
||||
var vouchers = CommonHelper.GetVouchers(login.Connection, cCardNum);
|
||||
|
||||
voucherId = $"{CommonHelper.GetVoucherId(login.Connection, voucherCode, vouchers)}";
|
||||
|
||||
var bizObjectId = cCardNum;
|
||||
|
||||
if (bUAP)
|
||||
{
|
||||
bizObjectId = $"UAPFORM.{bizObjectId}";
|
||||
}
|
||||
|
||||
return await SubmitResubmitMessage(login, bizObjectId, voucherId, voucherCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"审批流异常:{ex.Message}", ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string>
|
||||
{
|
||||
bSuccess = false,
|
||||
message = "提交失败",
|
||||
voucherCode = voucherCode,
|
||||
voucherId = voucherId,
|
||||
result = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// #提交审批流#
|
||||
/// </summary>
|
||||
/// <param name="login"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="voucherId"></param>
|
||||
/// <param name="bUAP"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessage(BaseLogin login, string cCardNum, object voucherId, bool bUAP = false)
|
||||
{
|
||||
var voucherCode = "";
|
||||
|
||||
try
|
||||
{
|
||||
var vouchers = CommonHelper.GetVouchers(login.Connection, cCardNum);
|
||||
|
||||
voucherCode = $"{CommonHelper.GetVoucherCode(login.Connection, voucherId, vouchers)}";
|
||||
|
||||
var bizObjectId = cCardNum;
|
||||
|
||||
if (bUAP)
|
||||
{
|
||||
bizObjectId = $"UAPFORM.{bizObjectId}";
|
||||
}
|
||||
|
||||
|
||||
return await SubmitResubmitMessage(login, bizObjectId, $"{voucherId}", voucherCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"审批流异常:{ex.Message}", ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string>
|
||||
{
|
||||
bSuccess = false,
|
||||
message = "提交失败",
|
||||
voucherCode = voucherCode,
|
||||
voucherId = $"{voucherId}",
|
||||
result = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// #取得代办任务#
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user