增加审核参数
This commit is contained in:
@@ -864,5 +864,35 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
var cDefWhere = vouchers.cDefWhere;
|
||||
return $"{cDefWhere} AND {tableName}.{fieldName}='{voucherId}'";
|
||||
}
|
||||
|
||||
public static string GetQuerySql(VouchersInfo vouchers, Dictionary<string, object> input, string cCardPostion="H")
|
||||
{
|
||||
var cBTQName = vouchers.cBTQName;
|
||||
var cBWQName = vouchers.cBWQName;
|
||||
|
||||
var voucherIdFieldName = vouchers.voucherIdFieldName;
|
||||
var tableName = cBTQName;
|
||||
|
||||
if (cCardPostion == "H")
|
||||
{
|
||||
tableName = cBWQName;
|
||||
}
|
||||
|
||||
if (cCardPostion == "B")
|
||||
{
|
||||
tableName = cBWQName;
|
||||
}
|
||||
|
||||
var cDefWhere = vouchers.cDefWhere;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(cDefWhere))
|
||||
{
|
||||
cDefWhere = "1=1";
|
||||
}
|
||||
|
||||
var strSql = $"SELECT DISTINCT {tableName}.* FROM {cBTQName} {cBTQName} LEFT JOIN {cBWQName} {cBWQName} ON {cBTQName}.[{voucherIdFieldName}]={cBWQName}.[{voucherIdFieldName}] WHERE {cDefWhere} ";
|
||||
|
||||
return strSql;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
/// </summary>
|
||||
public class clsVoucherCO_PU
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
protected readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private dynamic InitCo(BaseLogin login, vouchertype enmVoucherType, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
@@ -71,8 +71,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
try
|
||||
{
|
||||
var errorMsg = "";
|
||||
logInfo.Debug("开始输出登录信息");
|
||||
logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
@@ -80,10 +80,10 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domCur = new DOMDocument();
|
||||
|
||||
logInfo.Debug("开始获取单据默认模板...");
|
||||
_logInfo.Debug("开始获取单据默认模板...");
|
||||
co.GetVoucherData(ref domHead, ref domBody, "1=2");
|
||||
|
||||
logInfo.Debug("填充表头DOM...");
|
||||
_logInfo.Debug("填充表头DOM...");
|
||||
|
||||
domHead = dictionary.ToDocument2(domHead);
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
|
||||
logInfo.Debug($"获取新单号:{newCode}");
|
||||
_logInfo.Debug($"获取新单号:{newCode}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(newCode))
|
||||
{
|
||||
@@ -117,16 +117,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
}
|
||||
}
|
||||
|
||||
logInfo.Debug("填充表体DOM...");
|
||||
_logInfo.Debug("填充表体DOM...");
|
||||
domBody = dictionarys.ToDocument2(domBody);
|
||||
|
||||
if (bPrintDom)
|
||||
{
|
||||
logInfo.Debug("开始输入DOM...");
|
||||
_logInfo.Debug("开始输入DOM...");
|
||||
|
||||
logInfo.Debug(domHead.xml);
|
||||
_logInfo.Debug(domHead.xml);
|
||||
|
||||
logInfo.Debug(domBody.xml);
|
||||
_logInfo.Debug(domBody.xml);
|
||||
}
|
||||
|
||||
object vouchId = "";
|
||||
@@ -136,16 +136,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
|
||||
|
||||
|
||||
logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
_logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
|
||||
logInfo.Debug("开始查询单据配置...");
|
||||
_logInfo.Debug("开始查询单据配置...");
|
||||
var vouchers = CommonHelper.GetVouchers(baseLogin.Connection, cardNumber);
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
|
||||
if (bAudit)
|
||||
{
|
||||
logInfo.Debug("开始事务...");
|
||||
_logInfo.Debug("开始事务...");
|
||||
co.bOutTrans = true;
|
||||
|
||||
baseLogin.Connection.BeginTrans();
|
||||
@@ -154,16 +154,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
try
|
||||
{
|
||||
|
||||
logInfo.Debug("开始保存...");
|
||||
_logInfo.Debug("开始保存...");
|
||||
|
||||
errorMsg = bAudit
|
||||
? (string)co.VoucherSave2(ref domHead, ref domBody, VoucherState, ref vouchId, sOverDetailsXml, ref domMsg)
|
||||
: (string)co.VoucherSave(ref domHead, ref domBody, VoucherState, ref vouchId, ref curDom, UserMode, sOverDetailsXml, ref domMsg);
|
||||
|
||||
|
||||
logInfo.Debug("保存结束...");
|
||||
logInfo.Debug(errorMsg);
|
||||
logInfo.Debug($"{vouchId}");
|
||||
_logInfo.Debug("保存结束...");
|
||||
_logInfo.Debug(errorMsg);
|
||||
_logInfo.Debug($"{vouchId}");
|
||||
|
||||
res.bSuccess = string.IsNullOrWhiteSpace(errorMsg) && !string.IsNullOrWhiteSpace($"{vouchId}");
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
|
||||
res.message = "保存成功";
|
||||
|
||||
logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
_logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
|
||||
var strWhere = CommonHelper.GetVoucherWhereSqlById(vouchers, vouchId);
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
|
||||
if (bAudit)
|
||||
{
|
||||
logInfo.Debug("提交事务...");
|
||||
_logInfo.Debug("提交事务...");
|
||||
|
||||
baseLogin.Connection.CommitTrans();
|
||||
}
|
||||
@@ -270,7 +270,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -294,8 +294,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<List<BaseResult<string>>> Confirm(BaseLogin baseLogin, string sCardNum, vouchertype enmVoucherType, List<string> cCodes, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
logInfo.Debug("开始输出登录信息");
|
||||
logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
logInfo.Debug("开始获取单据数据...");
|
||||
_logInfo.Debug("开始获取单据数据...");
|
||||
voucherCO.GetVoucherData(ref domHead, ref domBody, strWhere);
|
||||
|
||||
var res = new BaseResult<string>
|
||||
@@ -525,8 +525,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<List<BaseResult<string>>> CancelConfirm(BaseLogin baseLogin, string sCardNum, vouchertype enmVoucherType, List<string> cCodes, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
logInfo.Debug("开始输出登录信息");
|
||||
logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
@@ -551,7 +551,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
logInfo.Debug("开始获取单据数据...");
|
||||
_logInfo.Debug("开始获取单据数据...");
|
||||
voucherCO.GetVoucherData(ref domHead, ref domBody, strWhere);
|
||||
|
||||
var res = new BaseResult<string>
|
||||
@@ -749,8 +749,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<List<BaseResult<string>>> Delete(BaseLogin baseLogin, string sCardNum, vouchertype enmVoucherType, List<string> cCodes, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
logInfo.Debug("开始输出登录信息");
|
||||
logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
@@ -775,7 +775,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
logInfo.Debug("开始获取单据数据...");
|
||||
_logInfo.Debug("开始获取单据数据...");
|
||||
voucherCO.GetVoucherData(ref domHead, ref domBody, strWhere);
|
||||
|
||||
var res = new BaseResult<string>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
using log4net;
|
||||
using ADODB;
|
||||
using log4net;
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using UFGeneralFilterOCX;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.PU;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
@@ -17,32 +21,241 @@ namespace UFIDA.U8.Framework.Api.ControlObject.SA
|
||||
/// </summary>
|
||||
public class ClsVoucherCO_SA
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
protected readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
public async Task<BaseResult<string>> Save(BaseLogin baseLogin, Dictionary<string, object> dictionary, string cardNumber, string VoucherState, bool bGetCode = false, string codeKey = null, bool bAudit = false, bool iswfcontrolled = false, string cFlowFieldName = "IsWfControlled")
|
||||
private dynamic InitCo(BaseLogin login, int enmVoucherType)
|
||||
{
|
||||
var errorMsg = "";
|
||||
|
||||
dynamic objr = new object();
|
||||
var aaa = "";
|
||||
|
||||
var co = "VoucherCO_Sa.ClsVoucherCO_SA".GetComObject();
|
||||
|
||||
co.Init(enmVoucherType: enmVoucherType, oLogin: ref login._vbLogin, oConn: ref login.Connection);
|
||||
|
||||
return co;
|
||||
}
|
||||
|
||||
public async Task<BaseResult<string>> Save(BaseLogin baseLogin, Dictionary<string, object> dictionary, string cardNumber, VoucherTypeSA enmVoucherType,int VoucherState=0, bool bGetCode = false, string codeKey = null, bool bAudit = false, bool iswfcontrolled = false, string cFlowFieldName = "IsWfControlled")
|
||||
{
|
||||
try
|
||||
{
|
||||
var errorMsg = "";
|
||||
logInfo.Debug("开始输出登录信息");
|
||||
logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
//var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
var co = InitCo(baseLogin, (int)enmVoucherType);
|
||||
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domCur = new DOMDocument();
|
||||
|
||||
return new BaseResult<string>();
|
||||
_logInfo.Debug("开始获取单据默认模板...");
|
||||
co.GetVoucherData(ref domHead, ref domBody, null, true, "1=2");
|
||||
|
||||
_logInfo.Debug("填充表头DOM...");
|
||||
|
||||
domHead = dictionary.ToDocument2(domHead);
|
||||
|
||||
if (!dictionary.TryGetValue("body", out var bodys))
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
if (!(bodys is List<Dictionary<string, object>> dictionarys) || dictionarys.Count <= 0)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
if (bGetCode)
|
||||
{
|
||||
errorMsg = "";
|
||||
var newCode = "";
|
||||
|
||||
if (!co.GetVoucherNO(ref domHead, ref newCode, ref errorMsg))
|
||||
{
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
|
||||
_logInfo.Debug($"获取新单号:{newCode}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(newCode))
|
||||
{
|
||||
domHead.SetDomKeyValue(codeKey, newCode);
|
||||
}
|
||||
}
|
||||
|
||||
_logInfo.Debug("填充表体DOM...");
|
||||
domBody = dictionarys.ToDocument2(domBody);
|
||||
|
||||
object vouchId = "";
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
IXMLDOMDocument2 curDom = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
|
||||
_logInfo.Debug("开始查询单据配置...");
|
||||
var vouchers = CommonHelper.GetVouchers(baseLogin.Connection, cardNumber);
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
|
||||
baseLogin.Connection.BeginTrans();
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
_logInfo.Debug("开始保存...");
|
||||
|
||||
errorMsg = co.Save(ref domHead, ref domBody, VoucherState, ref vouchId,ref domCur);
|
||||
|
||||
|
||||
_logInfo.Debug("保存结束...");
|
||||
_logInfo.Debug(errorMsg);
|
||||
_logInfo.Debug($"{vouchId}");
|
||||
|
||||
res.bSuccess = string.IsNullOrWhiteSpace(errorMsg) && !string.IsNullOrWhiteSpace($"{vouchId}");
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(domMsg.xml))
|
||||
{
|
||||
throw new Exception(domMsg.xml);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(curDom.xml))
|
||||
{
|
||||
throw new Exception(curDom.xml);
|
||||
}
|
||||
|
||||
throw new Exception("未知错误");
|
||||
|
||||
}
|
||||
|
||||
if (iswfcontrolled == false && VoucherState == 2)
|
||||
{
|
||||
var strSql = $"UPDATE {vouchers.cBTTblName} SET {cFlowFieldName} = 0 WHERE {vouchers.voucherIdFieldName}={vouchId}";
|
||||
|
||||
object rsts = new Recordset();
|
||||
|
||||
baseLogin.Connection.Execute(strSql, out rsts);
|
||||
}
|
||||
|
||||
|
||||
res.voucherCode = CommonHelper.GetVoucherCode(baseLogin.Connection, vouchId, vouchers);
|
||||
res.voucherId = $"{vouchId}";
|
||||
res.result = errorMsg;
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (bAudit)
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Trace.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
res.message = "保存失败";
|
||||
if (bAudit)
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
return res;
|
||||
}
|
||||
|
||||
res.message = "保存成功";
|
||||
|
||||
_logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
|
||||
var strWhere = CommonHelper.GetVoucherWhereSqlById(vouchers, vouchId);
|
||||
|
||||
if (res.bSuccess && bAudit)
|
||||
{
|
||||
try
|
||||
{
|
||||
errorMsg = VerifyVouch(co, baseLogin.Connection, enmVoucherType, res.voucherCode, res.voucherId, strWhere, true);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
res.bSuccess = false;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
_logInfo.Debug("提交事务...");
|
||||
|
||||
baseLogin.Connection.CommitTrans();
|
||||
|
||||
|
||||
return res;
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<BaseResult<string>> VerifyVouch(dynamic voucherCO, Connection conn, VoucherTypeSA sVouchType, string cCode, object vouchId, string strWhere,bool bVerify)
|
||||
{
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug("开始获取单据数据...");
|
||||
voucherCO.GetVoucherData(ref domHead, ref domBody, vouchId, true, strWhere);
|
||||
|
||||
var res = new BaseResult<string>
|
||||
{
|
||||
voucherCode = cCode,
|
||||
voucherId = $"{vouchId}"
|
||||
};
|
||||
|
||||
var errorMsg = voucherCO.VerifyVouch(ref domHead, bVerify);
|
||||
|
||||
res.bSuccess = string.IsNullOrWhiteSpace(errorMsg);
|
||||
|
||||
if (res.bSuccess)
|
||||
{
|
||||
res.message = "审核成功";
|
||||
res.result = res.voucherId;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
res.message = "审核失败";
|
||||
res.result = string.IsNullOrWhiteSpace(errorMsg) ? domMsg.xml : errorMsg;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.SA
|
||||
/// 发货单蓝字
|
||||
/// </summary>
|
||||
DispatchBlue=9,
|
||||
|
||||
SaleBillCommBlue = 2,
|
||||
SaleBillCommRed = 3,
|
||||
SaleBillDirect = 4,
|
||||
SaleBillSpecBlue = 0,
|
||||
SaleBillSpecRed = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
{
|
||||
logInfo.Debug("开始获取单据默认模板...");
|
||||
|
||||
if (!co.GetDefaultVoucherDom(sVouchType, cCardNum, ref domHead, ref domBody, ref domPosition,
|
||||
ref errorMsg) || !string.IsNullOrWhiteSpace(errorMsg))
|
||||
if (!co.GetDefaultVoucherDom(sVouchType, cCardNum, ref domHead, ref domBody, ref domPosition, ref errorMsg) || !string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
throw new Exception(errorMsg);
|
||||
}
|
||||
@@ -158,8 +157,6 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
if (!res2)
|
||||
{
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
throw new Exception(errorMsg);
|
||||
|
||||
@@ -168,12 +165,10 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
throw new Exception("审核单据时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
baseLogin.Connection.CommitTrans();
|
||||
|
||||
res.message = "新增成功";
|
||||
}
|
||||
|
||||
baseLogin.Connection.CommitTrans();
|
||||
|
||||
res.message = "新增成功";
|
||||
|
||||
}
|
||||
@@ -181,8 +176,6 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
{
|
||||
logInfo.Debug($"操作完成,操作结果:失败!------[{vouchId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
throw new Exception(errorMsg);
|
||||
|
||||
|
||||
@@ -249,11 +249,28 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
#endif
|
||||
}
|
||||
|
||||
_vbLogin = new VBLogin();
|
||||
|
||||
_vbLogin.ClearError();
|
||||
_logInfo.Debug($"VB--开始进行U8登录:{_netLogin.userToken}");
|
||||
_vbLogin.ConstructLogin(_netLogin.userToken);
|
||||
if (_netLogin != null)
|
||||
{
|
||||
_vbLogin = new VBLogin();
|
||||
|
||||
_vbLogin.ClearError();
|
||||
_logInfo.Debug($"VB--开始进行U8登录:{_netLogin.userToken}");
|
||||
_vbLogin.ConstructLogin(_netLogin.userToken);
|
||||
}
|
||||
else if(_vbLogin==null)
|
||||
{
|
||||
_vbLogin = new VBLogin();
|
||||
|
||||
_vbLogin.ClearError();
|
||||
|
||||
_logInfo.Debug($"VB--开始进行U8登录:{paramter.cSrv}--{paramter.pUserId}--{paramter.pAccId}");
|
||||
|
||||
if (!_vbLogin.Login(paramter.pSubId, paramter.pAccId, paramter.pYearId, paramter.pUserId, paramter.pPassword, paramter.pDate, paramter.cSrv, paramter.cSerial) && string.IsNullOrWhiteSpace(_vbLogin.userToken))
|
||||
{
|
||||
throw new Exception($"VB--U8登录失败---{_vbLogin.ShareString}");
|
||||
}
|
||||
}
|
||||
|
||||
var taskId = DateTime.Now.Ticks.ToString();
|
||||
_logInfo.Debug($"VB--设置参数:{taskId}");
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
@@ -174,6 +176,31 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
}
|
||||
|
||||
public BaseResult<dynamic> LoadData(string cCardNum, List<int> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataSet = new MOrderDs();
|
||||
|
||||
if (inputs == null || inputs.Count <= 0)
|
||||
throw new Exception("查询未返回任何结果");
|
||||
|
||||
foreach (var ds in inputs.Select(input => MOMExecutor.BFMOrder_LoadData("LoadById", input, new DefaultContextContainer())))
|
||||
{
|
||||
dataSet.Merge(ds);
|
||||
}
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "查询成功", result = dataSet };
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
//public BaseResult<dynamic> Verify(string cCardNum, List<string> inputs)
|
||||
//{
|
||||
// try
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
[{"TableName":"Customer","FieldName":"cCusCode","AsName":"cCusCode"}]
|
||||
@@ -0,0 +1,117 @@
|
||||
[
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cInvCCode",
|
||||
"AsName": "cInvCCode"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cInvCode",
|
||||
"AsName": "cInvCode"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cInvName",
|
||||
"AsName": "cInvName"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cInvStd",
|
||||
"AsName": "cInvStd"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cComUnitCode",
|
||||
"AsName": "cComUnitCode"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cAssComUnitCode",
|
||||
"AsName": "cAssComUnitCode"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cGroupCode",
|
||||
"AsName": "cGroupCode"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cBarCode",
|
||||
"AsName": "cBarCode"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "iTaxRate",
|
||||
"AsName": "iTaxRate"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "iTestStyle",
|
||||
"AsName": "iTestStyle"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "fLength",
|
||||
"AsName": "fLength"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "fWidth",
|
||||
"AsName": "fWidth"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "fHeight",
|
||||
"AsName": "fHeight"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "dModifyDate",
|
||||
"AsName": "dModifyDate"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cModifyPerson",
|
||||
"AsName": "cModifyPerson"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "bSelf",
|
||||
"AsName": "bSelf"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "bPurchase",
|
||||
"AsName": "bPurchase"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "dSDate",
|
||||
"AsName": "dSDate"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "dEDate",
|
||||
"AsName": "dEDate"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "dModifyDate",
|
||||
"AsName": "dModifyDate"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cDefWareHouse",
|
||||
"AsName": "cDefWareHouse"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cPackingType",
|
||||
"AsName": "cPackingType"
|
||||
},
|
||||
{
|
||||
"TableName": "Inventory",
|
||||
"FieldName": "cInvDepCode",
|
||||
"AsName": "cInvDepCode"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
[{"TableName":"Inventory","FieldName":"cInvCCode","AsName":"ParentID"}]
|
||||
@@ -568,6 +568,104 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.AAController">
|
||||
<summary>
|
||||
基础资料
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.AAController._logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Inventory_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询存货档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.ComputationUnit_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询计量单位档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Department_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询部门档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Warehouse_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询仓库档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.InventoryClass_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询存货分类档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Vendor_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询供应商档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.VendorClass_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询供应商分类档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Customer_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询客户档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.CustomerClass_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询客户分类档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Person_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询人员档案
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Operation_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询标准工序资料
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.APController">
|
||||
<summary>
|
||||
应收应付管理
|
||||
@@ -615,7 +713,7 @@
|
||||
平台功能
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.DPController.logInfo">
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.DPController._logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
@@ -684,17 +782,60 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.DPController.UploadConfig(System.String,System.Collections.Generic.List{System.Collections.Generic.Dictionary{System.String,System.Object}})">
|
||||
<summary>
|
||||
上传配置
|
||||
</summary>
|
||||
<param name="cKey"></param>
|
||||
<param name="inputs"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.DPController.DownloadConfig(System.String)">
|
||||
<summary>
|
||||
下载配置
|
||||
</summary>
|
||||
<param name="cKey"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.DPController.LoadLog(System.String)">
|
||||
<summary>
|
||||
查询日志
|
||||
</summary>
|
||||
<param name="dDate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.MOController">
|
||||
<summary>
|
||||
生产订单
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.MOController._logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO21_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询生产订单
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO2101_Load(System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
查询生产订单子件用料表
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.PUController">
|
||||
<summary>
|
||||
采购管理
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.PUController.logInfo">
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.PUController._logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
@@ -841,6 +982,33 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Load(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.String)">
|
||||
<summary>
|
||||
查询特定单据部分
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">查询条件</param>
|
||||
<param name="cCardPostion">查询所属区域 H:表头,B:表体</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="F:UFIDA.U8.Framework.Api.Controllers.U8.SAController._logInfo">
|
||||
<summary>
|
||||
日志组件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.SAController.Save(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Int32)">
|
||||
<summary>
|
||||
保存单据
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">报文</param>
|
||||
<param name="VoucherState">单据状态:0新增,1修改</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.SFCController">
|
||||
<summary>
|
||||
车间管理
|
||||
@@ -1114,7 +1282,7 @@
|
||||
日志组件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Insert(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Insert(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean,System.Nullable{System.Boolean})">
|
||||
<summary>
|
||||
新增单据
|
||||
</summary>
|
||||
@@ -1126,9 +1294,10 @@
|
||||
<param name="bIsRedVouch">是否红字单据</param>
|
||||
<param name="sAddedState">传空字符串</param>
|
||||
<param name="bReMote">是否远程</param>
|
||||
<param name="bVerify">是否生成时审核</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.InsertToken(System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.InsertToken(System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean,System.Nullable{System.Boolean})">
|
||||
<summary>
|
||||
新增单据
|
||||
</summary>
|
||||
@@ -1139,6 +1308,7 @@
|
||||
<param name="bIsRedVouch">是否红字单据</param>
|
||||
<param name="sAddedState">传空字符串</param>
|
||||
<param name="bReMote">是否远程</param>
|
||||
<param name="bVerify">是否生成时审核</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Verify(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Boolean)">
|
||||
@@ -1354,6 +1524,11 @@
|
||||
用户令牌
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:UFIDA.U8.Framework.Api.Entity.LoginOutput.loginParamter">
|
||||
<summary>
|
||||
登录参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.WebApiApplication.CurrentDomain_AssemblyResolve(System.Object,System.ResolveEventArgs)">
|
||||
<summary>
|
||||
缺少程序集全局处理事件
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"CVOUCHTYPE": "QM01",
|
||||
"CINSPECTCODE": "0000000001",
|
||||
"CSOURCECODE": "0000000001",
|
||||
"CSOURCEID": 1000000001,
|
||||
"DARRIVALDATE": "2014-12-03",
|
||||
"CDEPCODE": "0401",
|
||||
"CINSPECTDEPCODE": "0401",
|
||||
"CDEPNAME": "采购部",
|
||||
"CINSPECTDEPNAME": "采购部",
|
||||
"DDATE": "2014-12-03",
|
||||
"CTIME": "11:42:39",
|
||||
"CVENCODE": "01002",
|
||||
"CVENNAME": "深圳辰环手机配件有限公司",
|
||||
"CVENABBNAME": "辰环手机配件",
|
||||
"CSOURCE": "到货单",
|
||||
"IVTID": 351,
|
||||
"CMAKER": "demo",
|
||||
"CCHECKTYPECODE": "ARR",
|
||||
"CCHECKTYPENAME": "采购检验",
|
||||
"body": [
|
||||
{
|
||||
"SOURCEAUTOID": 1000000001,
|
||||
"ITESTSTYLE": 3,
|
||||
"CINVCODE": "010204",
|
||||
"CINVNAME": "大容量存储器",
|
||||
"CCOMUNITCODE": "0501",
|
||||
"CCOMUNITNAME": "个",
|
||||
"CUNITID": "0501",
|
||||
"CUNITNAME": "个",
|
||||
"FCHANGRATE": 1,
|
||||
"FQUANTITY": 100,
|
||||
"FNUM": 100,
|
||||
"BFLAG": 1,
|
||||
"IORDERTYPE": "0",
|
||||
"CPOCODE": "0000000009",
|
||||
"FSUMCHECKQTY": 100,
|
||||
"FSUMCHECKNUM": 100,
|
||||
"IGROUPTYPE": "1",
|
||||
"FUNCHECKQTY": 0,
|
||||
"FUNCHECKNUM": 0,
|
||||
"FBCCHECKQTY": 0,
|
||||
"FBCCHECKNUM": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
{
|
||||
"ivouchstate": "",
|
||||
"csysbarcode": "",
|
||||
"ccurrentauditor": "",
|
||||
"ivtid": "17",
|
||||
"ufts": "",
|
||||
"csource": "销售",
|
||||
"ccrechpname" :"",
|
||||
"cinfotypecode": "",
|
||||
"cstcode": "06",
|
||||
"retail_id": "",
|
||||
"csaleout": "",
|
||||
"crdcode": "",
|
||||
"cdepcode": "0304",
|
||||
"ccuscode": "0901",
|
||||
"cpaycode": "",
|
||||
"cstname": "电子商务",
|
||||
"ccusabbname": "淘宝",
|
||||
"ccusaddress": "",
|
||||
"ccusfax": "",
|
||||
"ccusbank": "",
|
||||
"ccusaccount": "",
|
||||
"ccusperson": "",
|
||||
"ccuspersoncode": "",
|
||||
"ccusoaddress": "",
|
||||
"bcashsale": "0",
|
||||
"ccuspaycond": "",
|
||||
"cpersoncode": "030401",
|
||||
"ccusotype": "",
|
||||
"sbvid": "0",
|
||||
"csbvcode": "0000000056",
|
||||
"cvouchtype": "27",
|
||||
"ddate": "2025-08-26",
|
||||
"csocode": "0000000176",
|
||||
"cdefine1": "",
|
||||
"cdefine2": "",
|
||||
"cdefine3": "",
|
||||
"cmaker": "demo",
|
||||
"cverifier": "",
|
||||
"cdepname": "电子商务",
|
||||
"cpersonname": "何彤",
|
||||
"iexchrate": "1",
|
||||
"itaxrate": "17.00",
|
||||
"cbillver": "",
|
||||
"cmemo": "",
|
||||
"cpayname": "",
|
||||
"breturnflag": "0",
|
||||
"bfirst": "0",
|
||||
"cbustype": "普通销售",
|
||||
"cbcode": "001",
|
||||
"cexch_name": "人民币",
|
||||
"cinvalider": "",
|
||||
"cbname": "中行光华路支行",
|
||||
"cbaccount": "9800031344000",
|
||||
"ccusregcode": "",
|
||||
"icuscreline": "0.00",
|
||||
"iarmoney": "",
|
||||
"cdefine4": "",
|
||||
"cdefine5": "",
|
||||
"cdefine6": "",
|
||||
"cdefine7": "",
|
||||
"cdefine8": "",
|
||||
"cdefine9": "",
|
||||
"cdefine10": "",
|
||||
"cdefine11": "",
|
||||
"cdefine12": "",
|
||||
"cdefine13": "",
|
||||
"cdefine14": "",
|
||||
"cdefine15": "",
|
||||
"cdefine16": "",
|
||||
"citem_class": "",
|
||||
"citemcode": "",
|
||||
"ccusname": "淘宝网",
|
||||
"clastcusname": "",
|
||||
"idisp": "1",
|
||||
"cdlcode": "0000000072",
|
||||
"caccounter": "",
|
||||
"cchecker": "",
|
||||
"bpayment": "",
|
||||
"ccusdefine1": "",
|
||||
"ccusdefine2": "",
|
||||
"ccusdefine3": "",
|
||||
"ccusdefine4": "",
|
||||
"ccusdefine5": "",
|
||||
"ccusdefine6": "",
|
||||
"ccusdefine7": "",
|
||||
"ccusdefine8": "",
|
||||
"ccusdefine9": "",
|
||||
"ccusdefine10": "",
|
||||
"ccusdefine11": "",
|
||||
"ccusdefine12": "",
|
||||
"ccusdefine13": "",
|
||||
"ccusdefine14": "",
|
||||
"ccusdefine15": "",
|
||||
"ccusdefine16": "",
|
||||
"cauthid": "",
|
||||
"csccode": "",
|
||||
"cscname": "",
|
||||
"cshipaddress": "",
|
||||
"cpayment": "",
|
||||
"cvouchtype2": "",
|
||||
"cvouchname": "销售普通发票",
|
||||
"ccccode": "",
|
||||
"cdccode": "",
|
||||
"caddcode": "",
|
||||
"cdeliverunit": "",
|
||||
"cbooktype": "",
|
||||
"cbookdepcode": "",
|
||||
"ccushand": "",
|
||||
"ccusphone": "",
|
||||
"ccontactname": "",
|
||||
"cmobilephone": "",
|
||||
"cofficephone": "",
|
||||
"iflowid": "0",
|
||||
"cflowname": "",
|
||||
"cgcroutecode": "",
|
||||
"cgcroutename": "",
|
||||
"cgatheringplan": "",
|
||||
"cgatheringplanname": "",
|
||||
"dcreditstart": "",
|
||||
"icreditdays": "",
|
||||
"dgatheringdate": "",
|
||||
"bcredit": "否",
|
||||
"cmodifier": "",
|
||||
"dmoddate": "",
|
||||
"dverifydate": "",
|
||||
"csscode": "",
|
||||
"cssname": "",
|
||||
"itaxbillstate": "",
|
||||
"ctaxbillcode": "",
|
||||
"ccustomerphone": "",
|
||||
"ccreditcuscode": "0901",
|
||||
"ccreditcusname": "淘宝网",
|
||||
"ioutgolden": "",
|
||||
"iverifystate": "0",
|
||||
"ireturncount": "",
|
||||
"icreditstate": "",
|
||||
"iswfcontrolled": "0",
|
||||
"dcreatesystime": "",
|
||||
"dverifysystime": "",
|
||||
"dmodifysystime": "",
|
||||
"iprintcount": "",
|
||||
"bnottogoldtax": "0",
|
||||
"cebtrnumber": "",
|
||||
"cebbuyer": "",
|
||||
"cebbuyernote": "",
|
||||
"cebprovince": "",
|
||||
"cebcity": "",
|
||||
"cebdistrict": "",
|
||||
"cinvoicecusname": "",
|
||||
"cgoldtaxcusname": "",
|
||||
"darverifydate": "",
|
||||
"darverifysystime": "",
|
||||
"chdefine1": "",
|
||||
"keyextend_t_sbvid_salebillvouch_extradefine_sbvid": "",
|
||||
"c154": "",
|
||||
"editprop": "A",
|
||||
"caddph": "北京市海淀区北清路68号",
|
||||
"cunitname": "星空电子公司",
|
||||
"cmyregcode": "110101020100011",
|
||||
"dsverifydate": "2015-01-02",
|
||||
"isfsupplymulti": "1",
|
||||
"isfminsupply": "1",
|
||||
"boverconsignment": "0",
|
||||
"bcheckvdate": "0",
|
||||
"saveafterok": "0",
|
||||
"body": [
|
||||
{
|
||||
"irowno": "1",
|
||||
"csocode": "0000000176",
|
||||
"cordercode": "0000000176",
|
||||
"iorderrowno": "1",
|
||||
"cwhcode": "50",
|
||||
"cwhname": "网购仓",
|
||||
"cinvcode": "0330",
|
||||
"cinvname": "三星手机S3",
|
||||
"csettleall": "未关闭",
|
||||
"bsettleall": "0",
|
||||
"itb": "0",
|
||||
"cinvm_unit": "台",
|
||||
"iquantity": "1.00",
|
||||
"igrouptype": "0",
|
||||
"iinvexchrate": ".000000",
|
||||
"fretsum": "0",
|
||||
"cgroupcode": "01",
|
||||
"itaxrate": "17.00",
|
||||
"inewquantity": "1.00",
|
||||
"inewmoney": "597.44",
|
||||
"inewtax": "101.56",
|
||||
"bsalepricefree1": "False",
|
||||
"bsalepricefree10": "False",
|
||||
"bsalepricefree2": "False",
|
||||
"bsalepricefree3": "False",
|
||||
"bsalepricefree4": "False",
|
||||
"bsalepricefree5": "False",
|
||||
"bsalepricefree6": "False",
|
||||
"bsalepricefree7": "False",
|
||||
"bsalepricefree8": "False",
|
||||
"bsalepricefree9": "False",
|
||||
"bfree1": "False",
|
||||
"bfree10": "False",
|
||||
"bfree2": "False",
|
||||
"bfree3": "False",
|
||||
"bfree4": "False",
|
||||
"bfree5": "False",
|
||||
"bfree6": "False",
|
||||
"bfree7": "False",
|
||||
"bfree8": "False",
|
||||
"bfree9": "False",
|
||||
"inewsum": "699",
|
||||
"inewnatmoney": "597.44",
|
||||
"inewnattax": "101.56",
|
||||
"btracksalebill": "0",
|
||||
"fretqtywkp": "0",
|
||||
"inewnatsum": "699",
|
||||
"foutquantity": "0",
|
||||
"iretquantity": "0",
|
||||
"isettlequantity": "0",
|
||||
"isettlenum": "0",
|
||||
"iquotedprice": "999.00",
|
||||
"bbatchcreate": "False",
|
||||
"bbatchproperty1": "False",
|
||||
"bbatchproperty10": "False",
|
||||
"bbatchproperty2": "False",
|
||||
"bbatchproperty3": "False",
|
||||
"bbatchproperty4": "False",
|
||||
"bbatchproperty5": "False",
|
||||
"bbatchproperty6": "False",
|
||||
"bbatchproperty7": "False",
|
||||
"bbatchproperty8": "False",
|
||||
"bbatchproperty9": "False",
|
||||
"itaxunitprice": "699.00",
|
||||
"iunitprice": "597.44",
|
||||
"imoney": "597.44",
|
||||
"fretailrealamount": ".000000000",
|
||||
"fretailsettleamount": ".000000000",
|
||||
"itax": "101.56",
|
||||
"isum": "699.00",
|
||||
"inatunitprice": "597.44",
|
||||
"inatmoney": "597.44",
|
||||
"inattax": "101.56",
|
||||
"bservice": "False",
|
||||
"binvtype": "False",
|
||||
"inatsum": "699.00",
|
||||
"fsaleprice": "0.00",
|
||||
"kl": "69.97",
|
||||
"kl2": "100.00",
|
||||
"dkl1": "30.03",
|
||||
"dkl2": "0.00",
|
||||
"idiscount": "300.00",
|
||||
"inewdiscount": "300",
|
||||
"inewnatdiscount": "300",
|
||||
"inatdiscount": "300.00",
|
||||
"bgsp": "0",
|
||||
"btrack": "False",
|
||||
"binvbatch": "False",
|
||||
"binvquality": "False",
|
||||
"bqaneedcheck": "0",
|
||||
"bqaurgency": "0",
|
||||
"bproxywh": "False",
|
||||
"csrpolicy": "PE",
|
||||
"dlid": "1000000100",
|
||||
"idlsid": "1000000160",
|
||||
"isosid": "1000000320",
|
||||
"ibatch": "0",
|
||||
"icorid": "1000000160",
|
||||
"idemandseq": "1",
|
||||
"idemandtype": "1",
|
||||
"cdemandcode": "0000000176",
|
||||
"cdemandid": "1000000320",
|
||||
"cbdlcode": "0000000072",
|
||||
"bptomodel": "否",
|
||||
"binvmodel": "否",
|
||||
"bsaleprice": "1",
|
||||
"bgift": "0",
|
||||
"selcol": "Y",
|
||||
"editprop": "A",
|
||||
"inattaxunitprice": "699.00",
|
||||
"cfree1": "",
|
||||
"cfree2": "",
|
||||
"cfree3": "",
|
||||
"cfree4": "",
|
||||
"cfree5": "",
|
||||
"cfree6": "",
|
||||
"cfree7": "",
|
||||
"cfree8": "",
|
||||
"cfree9": "",
|
||||
"cfree10": "",
|
||||
"tbquantity": "0",
|
||||
"cfactorycode": "",
|
||||
"iexchsum": "0",
|
||||
"imoneysum": "0",
|
||||
"cmassunit": "0",
|
||||
"bcheckbatch": "0",
|
||||
"bcosting": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Description;
|
||||
using System.Web.UI.WebControls;
|
||||
using log4net;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
@@ -22,7 +27,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <summary>
|
||||
/// 日志组件
|
||||
/// </summary>
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
protected readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// U8登录接口
|
||||
@@ -36,7 +41,8 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
try
|
||||
{
|
||||
logInfo.Debug($"当前接口:api/U8/DP/Login,参数:{input.ToJson()}");
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/DP/Login,参数:{input.ToJson()}");
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
@@ -81,7 +87,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -90,7 +96,6 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// U8登录接口
|
||||
/// </summary>
|
||||
@@ -103,7 +108,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
try
|
||||
{
|
||||
|
||||
logInfo.Debug($"当前接口:api/U8/DP/Login/Token,参数:{input.ToJson()}");
|
||||
_logInfo.Debug($"当前接口:api/U8/DP/Login/Token,参数:{input.ToJson()}");
|
||||
|
||||
var token = CommUnit.GetUserToken(input.userToken);
|
||||
|
||||
@@ -123,7 +128,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -149,7 +154,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "登录失败", result = ex.Message };
|
||||
}
|
||||
@@ -176,7 +181,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "查询失败", result = ex.Message };
|
||||
}
|
||||
@@ -200,7 +205,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "加密失败", result = ex.Message };
|
||||
}
|
||||
@@ -224,7 +229,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "解密失败", result = ex.Message };
|
||||
}
|
||||
@@ -259,7 +264,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Debug($"密码未加密:{ex.Message},将进行密码加密");
|
||||
_logInfo.Debug($"密码未加密:{ex.Message},将进行密码加密");
|
||||
|
||||
input.cPassword = CommUnit.GetEncrypt(input.cPassword);
|
||||
}
|
||||
@@ -270,7 +275,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
@@ -306,7 +311,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Debug($"密码未加密:{ex.Message},将进行密码加密");
|
||||
_logInfo.Debug($"密码未加密:{ex.Message},将进行密码加密");
|
||||
|
||||
input.cPassword = CommUnit.GetEncrypt(input.cPassword);
|
||||
}
|
||||
@@ -317,7 +322,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "更新失败", result = ex.Message };
|
||||
}
|
||||
@@ -344,10 +349,110 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "查询失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传配置
|
||||
/// </summary>
|
||||
/// <param name="cKey"></param>
|
||||
/// <param name="inputs"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/DP/UploadConfig")]
|
||||
public async Task<BaseResult<string>> UploadConfig(string cKey,[FromBody] List<Dictionary<string,object>> inputs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"App_Data/{cKey}.json");
|
||||
|
||||
File.WriteAllText(fileName, inputs.ToJson());
|
||||
|
||||
return new BaseResult<string>()
|
||||
{
|
||||
result = "上传成功",
|
||||
message = "上传成功",
|
||||
bSuccess = true
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "查询失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载配置
|
||||
/// </summary>
|
||||
/// <param name="cKey"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/DP/DownloadConfig")]
|
||||
public async Task<BaseResult<string>> DownloadConfig(string cKey)
|
||||
{
|
||||
try
|
||||
{
|
||||
var fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"App_Data/{cKey}.json");
|
||||
|
||||
var txt=File.ReadAllText(fileName );
|
||||
|
||||
return new BaseResult<string>()
|
||||
{
|
||||
result = txt,
|
||||
message = "上传成功",
|
||||
bSuccess = true
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "查询失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询日志
|
||||
/// </summary>
|
||||
/// <param name="dDate"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/DP/LoadLog")]
|
||||
public async Task<string> LoadLog(string dDate)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!DateTime.TryParse(dDate, out var cDate))
|
||||
{
|
||||
throw new Exception("日期格式错误");
|
||||
}
|
||||
|
||||
var fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log/Log_{cDate:yyyyMMdd}.log");
|
||||
|
||||
var txt = File.ReadAllLines(fileName);
|
||||
|
||||
return string.Join(Environment.NewLine, txt);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return ex.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
using System;
|
||||
using log4net;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Entity;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
@@ -12,6 +20,363 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// </summary>
|
||||
public class MOController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志组件
|
||||
/// </summary>
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
|
||||
/// <summary>
|
||||
/// 查询生产订单
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/MO/MO21/Load")]
|
||||
public async Task<BaseResult<dynamic>> MO21_Load(string cAccId,[FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
try
|
||||
{
|
||||
//var userToken = Request.Headers.GetValues("userToken").First();
|
||||
|
||||
//if (userToken!= "04fafa004ad8851485d9026229964a488f2080907248680178bae68a236b33bc086aa234c94927e4099f21209bea98640ad4e9b1b5319cd5f55144606d82f3dbeff44ec66575ca2438144df9fa3f3e1babd80a140d2170975a031fca1ade326234b4d9a61386")
|
||||
//{
|
||||
// throw new Exception("调用信息不正确,请确认参数");
|
||||
//}
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:MO21,操作:查询,对接账套:{cAccId},条件:{input.ToJson()}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var db = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
ConfigId = cAccId,
|
||||
ConnectionString = baseLogin.UFDataConnstringForNet
|
||||
});
|
||||
|
||||
var mo21Txt = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data/MO21.json"));
|
||||
|
||||
var mo21s = mo21Txt.ToObject<List<QuerySelect>>();
|
||||
|
||||
var query = db.Queryable<dynamic>().AS("v_mom_order_wf", "v_mom_order_wf")
|
||||
.AddJoinInfo("v_mom_orderdetail_wf", "v_mom_orderdetail_wf", "v_mom_order_wf.MoId=v_mom_orderdetail_wf.MoId");
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable("mom_order_extradefine", false))
|
||||
{
|
||||
query.AddJoinInfo("mom_order_extradefine", "mom_order_extradefine",
|
||||
"v_mom_order_wf.MoId=mom_order_extradefine.MoId");
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable("mom_orderdetail_extradefine", false))
|
||||
{
|
||||
query.AddJoinInfo("mom_orderdetail_extradefine", "mom_order_extradefine",
|
||||
"v_mom_orderdetail_wf.MoDId=mom_orderdetail_extradefine.MoDId");
|
||||
}
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
var conModels = new List<IConditionalModel>();
|
||||
|
||||
foreach (var o in input)
|
||||
{
|
||||
if (o.Key == "MoId" && input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "v_mom_order_wf.MoId",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key == "MoId")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "v_mom_order_wf.MoId",
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key == "MoId__2")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "v_mom_order_wf.MoId",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}else if (o.Key == "MoDId" && input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "v_mom_orderdetail_wf.MoDId",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key == "MoDId")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "v_mom_orderdetail_wf.MoDId",
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key == "MoDId__2")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "v_mom_orderdetail_wf.MoDId",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key.EndsWith("__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key.Replace("__2", "")}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = o.Key,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
query.Where(conModels);
|
||||
}
|
||||
|
||||
if (mo21s != null && mo21s.Count > 0)
|
||||
{
|
||||
var selector = new List<SelectModel>();
|
||||
|
||||
foreach (var mo21 in mo21s)
|
||||
{
|
||||
var model = new SelectModel() { FieldName = $"{mo21.TableName}.{mo21.FieldName}" };
|
||||
|
||||
if (mo21.AsName != null && !string.IsNullOrWhiteSpace(mo21.AsName))
|
||||
{
|
||||
model.AsName = mo21.AsName;
|
||||
}
|
||||
|
||||
selector.Add(model);
|
||||
}
|
||||
|
||||
query.Select(selector);
|
||||
}
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "查询成功", result = await query.ToListAsync() };
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"作业Id:{workId}-----错误信息:{ex.Message}", ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询生产订单子件用料表
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/MO/MO2101/Load")]
|
||||
public async Task<BaseResult<dynamic>> MO2101_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
try
|
||||
{
|
||||
//var userToken = Request.Headers.GetValues("userToken").First();
|
||||
|
||||
//if (userToken != "04fafa004ad8851485d9026229964a488f2080907248680178bae68a236b33bc086aa234c94927e4099f21209bea98640ad4e9b1b5319cd5f55144606d82f3dbeff44ec66575ca2438144df9fa3f3e1babd80a140d2170975a031fca1ade326234b4d9a61386")
|
||||
//{
|
||||
// throw new Exception("调用信息不正确,请确认参数");
|
||||
//}
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:MO2101,操作:查询,对接账套:{cAccId},条件:{input.ToJson()}");
|
||||
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var db = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
ConfigId = cAccId,
|
||||
ConnectionString = baseLogin.UFDataConnstringForNet
|
||||
});
|
||||
|
||||
var mo2101Txt = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data/MO2101.json"));
|
||||
|
||||
var mo2101s = mo2101Txt.ToObject<List<QuerySelect>>();
|
||||
|
||||
var query = db.Queryable<dynamic>().AS("mom_moallocate", "mom_moallocate");
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable("mom_moallocate_extradefine", false))
|
||||
{
|
||||
query.AddJoinInfo("mom_moallocate_extradefine", "mom_moallocate_extradefinemom_moallocate_extradefine",
|
||||
"om_moallocate.AllocateId=mom_moallocate_extradefine.AllocateId");
|
||||
}
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
var conModels = new List<IConditionalModel>();
|
||||
|
||||
foreach (var o in input)
|
||||
{
|
||||
if (o.Key == "AllocateId" && input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "mom_moallocate.AllocateId",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key == "AllocateId")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "mom_moallocate.AllocateId",
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key == "AllocateId__2")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "mom_moallocate.AllocateId",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key.EndsWith("__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key.Replace("__2", "")}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = o.Key,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
query.Where(conModels);
|
||||
}
|
||||
|
||||
if (mo2101s != null && mo2101s.Count > 0)
|
||||
{
|
||||
var selector = new List<SelectModel>();
|
||||
|
||||
foreach (var mo2101 in mo2101s)
|
||||
{
|
||||
var model = new SelectModel() { FieldName = $"{mo2101.TableName}.{mo2101.FieldName}" };
|
||||
|
||||
if (mo2101.AsName != null && !string.IsNullOrWhiteSpace(mo2101.AsName))
|
||||
{
|
||||
model.AsName = mo2101.AsName;
|
||||
}
|
||||
|
||||
selector.Add(model);
|
||||
}
|
||||
|
||||
query.Select(selector);
|
||||
}
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "查询成功", result = await query.ToListAsync() };
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"作业Id:{workId}-----错误信息:{ex.Message}", ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ using UFIDA.U8.Framework.Api.ControlObject.ST;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Models;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
using static System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <summary>
|
||||
/// 日志组件
|
||||
/// </summary>
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
protected readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
|
||||
@@ -56,13 +57,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{cAccId},数据:{input.ToJson()}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{cAccId},数据:{input.ToJson()}");
|
||||
|
||||
//LoginParamter param;
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -84,7 +85,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
// param = await CommUnit.GetLoginParamter(cAccId);
|
||||
//}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -100,45 +101,45 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
bGetCode = true;
|
||||
codeKey = defs.Where(a => a.bDefault == true && a.cPosition == "H" && a.DefaultValue == "单号" && a.bEnable == true).Select(a => a.FieldName).First();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----配置获取单号");
|
||||
_logInfo.Debug($"作业Id:{workId}-----配置获取单号");
|
||||
}
|
||||
else
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----没有单号需要自动指定");
|
||||
_logInfo.Debug($"作业Id:{workId}-----没有单号需要自动指定");
|
||||
}
|
||||
|
||||
#region 调整日期,去掉时间部分
|
||||
|
||||
if (input.ContainsKey("ddate"))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----调整日期,去掉时间部分");
|
||||
_logInfo.Debug($"作业Id:{workId}-----调整日期,去掉时间部分");
|
||||
input["ddate"] = $"{Convert.ToDateTime(input["ddate"]):yyyy-MM-dd}";
|
||||
}
|
||||
|
||||
if (input.ContainsKey("dtvdate"))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----调整日期,去掉时间部分");
|
||||
_logInfo.Debug($"作业Id:{workId}-----调整日期,去掉时间部分");
|
||||
input["dtvdate"] = $"{Convert.ToDateTime(input["dtvdate"]):yyyy-MM-dd}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
logInfo.Debug($"作业Id:{workId}-----设置表头数据");
|
||||
_logInfo.Debug($"作业Id:{workId}-----设置表头数据");
|
||||
input.SetDictionaryData(defs, baseLogin.Connection, newNumber);
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----读取表体数据");
|
||||
_logInfo.Debug($"作业Id:{workId}-----读取表体数据");
|
||||
var bodyData = input[voucherInfo.BodyName].ToJson().ToList<Dictionary<string, object>>(); //读取表体的数据
|
||||
|
||||
if (bodyData == null || bodyData.Count <= 0)
|
||||
throw new Exception("无表体数据!");
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----获取表体字段配置");
|
||||
_logInfo.Debug($"作业Id:{workId}-----获取表体字段配置");
|
||||
var defsBody = await db.Queryable<SysU8FieldDefine>().Where(s => s.CardNumber == cCardNum && s.cPosition == "B" && s.bEnable == true).ToListAsync(); //获取表体的字段配置
|
||||
|
||||
var rowNo = 1;
|
||||
|
||||
foreach (var body in bodyData)
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----设置第{rowNo}行单据数据");
|
||||
_logInfo.Debug($"作业Id:{workId}-----设置第{rowNo}行单据数据");
|
||||
body.SetDictionaryData(defsBody, baseLogin.Connection, newNumber, rowNo);
|
||||
|
||||
rowNo++;
|
||||
@@ -154,7 +155,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
@@ -182,13 +183,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},单号:{cCode}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},单号:{cCode}");
|
||||
|
||||
//LoginParamter param;
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin) || baseLogin == null)
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -210,7 +211,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
// param = await CommUnit.GetLoginParamter(cAccId);
|
||||
//}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -220,7 +221,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
@@ -248,11 +249,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},ID:{voucherId}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},ID:{voucherId}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -270,7 +271,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -280,7 +281,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
@@ -337,13 +338,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
strId = string.Join(",", voucherIds);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},单号:{strCode},ID:{strId}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},单号:{strCode},ID:{strId}");
|
||||
|
||||
//LoginParamter param;
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -365,7 +366,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
// param = await CommUnit.GetLoginParamter(cAccId);
|
||||
//}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -386,7 +387,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<List<BaseResult<string>>> { bSuccess = false, message = ex.Message, result = null };
|
||||
}
|
||||
@@ -414,11 +415,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},单号:{cCode}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},单号:{cCode}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin) || baseLogin == null)
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -436,7 +437,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -446,7 +447,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
}
|
||||
@@ -474,11 +475,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},ID:{voucherId}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},ID:{voucherId}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -496,7 +497,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -506,7 +507,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
}
|
||||
@@ -563,13 +564,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
strId = string.Join(",", voucherIds);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},单号:{strCode},ID:{strId}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},单号:{strCode},ID:{strId}");
|
||||
|
||||
//LoginParamter param;
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -591,7 +592,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
// param = await CommUnit.GetLoginParamter(cAccId);
|
||||
//}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -612,7 +613,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<List<BaseResult<string>>> { bSuccess = false, message = ex.Message, result = null };
|
||||
}
|
||||
@@ -640,11 +641,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},单号:{cCode}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},单号:{cCode}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin) || baseLogin == null)
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -662,7 +663,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -672,7 +673,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
@@ -700,11 +701,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},ID:{voucherId}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},ID:{voucherId}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -722,7 +723,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -732,7 +733,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
@@ -754,12 +755,12 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
[Route("api/U8/PU/{cCardNum}/Delete")]
|
||||
public async Task<BaseResult<List<BaseResult<string>>>> Delete(string cAccId, string cCardNum, [FromBody] STInput input, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
try
|
||||
{
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (input == null)
|
||||
{
|
||||
throw new Exception("参数不能为空");
|
||||
@@ -789,11 +790,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
strId = string.Join(",", voucherIds);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},单号:{strCode},ID:{strId}");
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},单号:{strCode},ID:{strId}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
@@ -811,7 +812,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
@@ -832,11 +833,259 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<List<BaseResult<string>>> { bSuccess = false, message = ex.Message, result = null };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询特定单据部分
|
||||
/// </summary>
|
||||
/// <param name="cAccId">系统号</param>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <param name="cCardPostion">查询所属区域 H:表头,B:表体</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[Route("api/U8/PU/{cCardNum}/Load")]
|
||||
[Route("api/U8/PU/{cCardNum}/Load/{cCardPostion}")]
|
||||
public async Task<BaseResult<dynamic>> Load(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input, string cCardPostion = "H")
|
||||
{
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
try
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:查询,对接账套:{cAccId},条件:{input.ToJson()}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var vouchers = CommonHelper.GetVouchers(baseLogin.Connection, cCardNum);
|
||||
|
||||
if (vouchers == null)
|
||||
{
|
||||
throw new Exception("未能获取到单据配置信息");
|
||||
}
|
||||
|
||||
var db = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
ConfigId = cAccId,
|
||||
ConnectionString = baseLogin.UFDataConnstringForNet
|
||||
});
|
||||
|
||||
var cBTQName = vouchers.cBTQName;
|
||||
var cBWQName = vouchers.cBWQName;
|
||||
var cBTTblName = vouchers.cBTTblName;
|
||||
var cBWTblName = vouchers.cBWTblName;
|
||||
var voucherIdFieldName = vouchers.voucherIdFieldName;
|
||||
var vouchersIdFieldName = "";
|
||||
var tableName = cBTQName;
|
||||
var colsHeadList=new List<string>();
|
||||
var colsBodyList=new List<string>();
|
||||
var bExtHead = false;
|
||||
var bExtBody = false;
|
||||
|
||||
if (cCardPostion == "H")
|
||||
{
|
||||
tableName = cBWQName;
|
||||
}
|
||||
|
||||
if (cCardPostion == "B")
|
||||
{
|
||||
tableName = cBWQName;
|
||||
}
|
||||
|
||||
var cDefWhere = vouchers.cDefWhere;
|
||||
|
||||
var query = db.Queryable<dynamic>().AS(cBTQName, cBTQName);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(cBWQName))
|
||||
{
|
||||
query.AddJoinInfo(cBWQName, cBWQName, $"{cBTQName}.[{voucherIdFieldName}]={cBWQName}.[{voucherIdFieldName}]");
|
||||
|
||||
var bodyCols = db.DbMaintenance.GetColumnInfosByTableName(cBWQName);
|
||||
|
||||
if (bodyCols != null && bodyCols.Count > 0)
|
||||
{
|
||||
colsBodyList.AddRange(from col in bodyCols where !col.DbColumnName.ToLower().Contains("ufts") && col.DbColumnName.ToLower()!=voucherIdFieldName select $"{cBWQName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
|
||||
var headCols = db.DbMaintenance.GetColumnInfosByTableName(cBTQName);
|
||||
|
||||
if(headCols!=null && headCols.Count > 0)
|
||||
{
|
||||
colsHeadList.AddRange(from col in headCols where !col.DbColumnName.ToLower().Contains("ufts") select $"{cBTQName}.[{col.DbColumnName}]");
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable($"{cBTTblName}_extradefine", false))
|
||||
{
|
||||
bExtHead = true;
|
||||
var cols = db.DbMaintenance.GetColumnInfosByTableName($"{cBTTblName}_extradefine");
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols)
|
||||
{
|
||||
if (col.DbColumnName.ToLower().StartsWith("chdefine"))
|
||||
{
|
||||
colsHeadList.Add($"{cBTTblName}_extradefine.[{col.DbColumnName.ToLower()}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
vouchersIdFieldName = col.DbColumnName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query.AddJoinInfo($"{cBTTblName}_extradefine", $"{cBTTblName}_extradefine", $"{cBTQName}.[{voucherIdFieldName}]={cBTTblName}_extradefine.[{voucherIdFieldName}]");
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable($"{cBWTblName}_extradefine", false))
|
||||
{
|
||||
bExtBody = true;
|
||||
var cols= db.DbMaintenance.GetColumnInfosByTableName($"{cBWTblName}_extradefine");
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols)
|
||||
{
|
||||
if (col.DbColumnName.ToLower().StartsWith("cbdefine"))
|
||||
{
|
||||
colsBodyList.Add($"{cBWTblName}_extradefine.[{col.DbColumnName.ToLower()}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
vouchersIdFieldName = col.DbColumnName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query.AddJoinInfo($"{cBWTblName}_extradefine", $"{cBWTblName}_extradefine", $"{cBWQName}.[{vouchersIdFieldName}]={cBWTblName}_extradefine.[{vouchersIdFieldName}]");
|
||||
}
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
var conModels = new List<IConditionalModel>();
|
||||
|
||||
foreach (var o in input)
|
||||
{
|
||||
if (o.Key == "dModifyDate")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "caudittime",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if(o.Key == "dModifyDate__2")
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = "caudittime",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if ($"{o.Value}".EndsWith("%") || $"{o.Value}".StartsWith("%"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key}",
|
||||
ConditionalType = ConditionalType.Like,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (o.Key.EndsWith("__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key.Replace("__2", "")}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{o.Key}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = o.Key,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
query.Where(conModels);
|
||||
}
|
||||
|
||||
query.Where(cDefWhere);
|
||||
|
||||
if (cCardPostion == "H")
|
||||
{
|
||||
if (bExtHead)
|
||||
{
|
||||
query.Select($"{string.Join(",", colsHeadList)}").Distinct();
|
||||
}
|
||||
else
|
||||
{
|
||||
query.Select($"{string.Join(",", colsHeadList)}").Distinct();
|
||||
}
|
||||
}
|
||||
|
||||
if (cCardPostion == "B")
|
||||
{
|
||||
if (bExtBody)
|
||||
{
|
||||
query.Select($"{string.Join(",",colsBodyList)}").Distinct();
|
||||
}
|
||||
else
|
||||
{
|
||||
query.Select($"{string.Join(",", colsBodyList)}").Distinct();
|
||||
}
|
||||
}
|
||||
|
||||
_logInfo.Debug(query.ToSqlString());
|
||||
|
||||
return new BaseResult<dynamic>() { bSuccess = true, message = "查询成功", result = await query.ToListAsync() };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
using log4net;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using System.Web.UI.WebControls;
|
||||
using UFIDA.U8.Framework.Api.Common.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.PU;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.SA;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
public class SAController : ApiController
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 日志组件
|
||||
/// </summary>
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private static readonly MemoryCache _cache = new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromMinutes(10) });
|
||||
|
||||
/// <summary>
|
||||
/// 保存单据
|
||||
/// </summary>
|
||||
/// <param name="cAccId">系统号</param>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">报文</param>
|
||||
/// <param name="VoucherState">单据状态:0新增,1修改</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[Route("api/U8/SA/{cCardNum}/Save")]
|
||||
public async Task<BaseResult<string>> Save(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input, int VoucherState = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{cAccId},数据:{input.ToJson()}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
var param = await CommUnit.GetLoginParamter(cAccId);
|
||||
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("未能加载指定系统号的登录信息");
|
||||
}
|
||||
|
||||
baseLogin.Init(param, false);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
var voucherInfo = await db.Queryable<SysU8VoucherDefine>().FirstAsync(s => s.CardNumber == cCardNum);
|
||||
|
||||
var defs = await db.Queryable<SysU8FieldDefine>().Where(s => s.CardNumber == cCardNum && s.cPosition == "H" && s.bEnable == true).ToListAsync(); //查询表头字段配置,供后续设置字段值
|
||||
|
||||
|
||||
var newNumber = "";
|
||||
var bGetCode = false;
|
||||
var codeKey = "";
|
||||
|
||||
if (defs.Any(a => a.bDefault == true && a.cPosition == "H" && a.DefaultValue == "单号" && a.bEnable == true))
|
||||
{
|
||||
bGetCode = true;
|
||||
codeKey = defs.Where(a => a.bDefault == true && a.cPosition == "H" && a.DefaultValue == "单号" && a.bEnable == true).Select(a => a.FieldName).First();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----配置获取单号");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----没有单号需要自动指定");
|
||||
}
|
||||
|
||||
#region 调整日期,去掉时间部分
|
||||
|
||||
if (input.ContainsKey("ddate"))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----调整日期,去掉时间部分");
|
||||
input["ddate"] = $"{Convert.ToDateTime(input["ddate"]):yyyy-MM-dd}";
|
||||
}
|
||||
|
||||
if (input.ContainsKey("dtvdate"))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----调整日期,去掉时间部分");
|
||||
input["dtvdate"] = $"{Convert.ToDateTime(input["dtvdate"]):yyyy-MM-dd}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
_logInfo.Debug($"作业Id:{workId}-----设置表头数据");
|
||||
input.SetDictionaryData(defs, baseLogin.Connection, newNumber);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----读取表体数据");
|
||||
var bodyData = input[voucherInfo.BodyName].ToJson().ToList<Dictionary<string, object>>(); //读取表体的数据
|
||||
|
||||
if (bodyData == null || bodyData.Count <= 0)
|
||||
throw new Exception("无表体数据!");
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----获取表体字段配置");
|
||||
var defsBody = await db.Queryable<SysU8FieldDefine>().Where(s => s.CardNumber == cCardNum && s.cPosition == "B" && s.bEnable == true).ToListAsync(); //获取表体的字段配置
|
||||
|
||||
var rowNo = 1;
|
||||
|
||||
foreach (var body in bodyData)
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----设置第{rowNo}行单据数据");
|
||||
body.SetDictionaryData(defsBody, baseLogin.Connection, newNumber, rowNo);
|
||||
|
||||
rowNo++;
|
||||
}
|
||||
|
||||
input[voucherInfo.BodyName] = bodyData;
|
||||
|
||||
var co = new ClsVoucherCO_SA();
|
||||
|
||||
var res = await co.Save(baseLogin, input, cCardNum, (VoucherTypeSA)Convert.ToInt32(voucherInfo.VoucherType), VoucherState,bGetCode, codeKey, voucherInfo.bVerify, voucherInfo.iswfcontrolled, voucherInfo.cFlowFieldName);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,7 @@ using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using UFIDA.U8.Framework.Api.Common.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
@@ -46,10 +44,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <param name="bIsRedVouch">是否红字单据</param>
|
||||
/// <param name="sAddedState">传空字符串</param>
|
||||
/// <param name="bReMote">是否远程</param>
|
||||
/// <param name="bVerify">是否生成时审核</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/ST/{cCardNum}/Insert")]
|
||||
public async Task<BaseResult<string>> Insert(string cAccId ,string cCardNum,[FromBody] Dictionary<string, object> input, bool bCheck = true,bool bBeforCheckStock=true,bool bIsRedVouch=false,string sAddedState="",bool bReMote=false)
|
||||
public async Task<BaseResult<string>> Insert(string cAccId ,string cCardNum,[FromBody] Dictionary<string, object> input, bool bCheck = true,bool bBeforCheckStock=true,bool bIsRedVouch=false,string sAddedState="",bool bReMote=false,bool? bVerify=null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -244,7 +243,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
var res = await co.Insert(baseLogin, input, cCardNum, voucherInfo.VoucherType, bGetCode, codeKey, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote, voucherInfo.bVerify,voucherInfo.bPrintDom);
|
||||
var res = await co.Insert(baseLogin, input, cCardNum, voucherInfo.VoucherType, bGetCode, codeKey, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote, bVerify??voucherInfo.bVerify,voucherInfo.bPrintDom);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -267,10 +266,11 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <param name="bIsRedVouch">是否红字单据</param>
|
||||
/// <param name="sAddedState">传空字符串</param>
|
||||
/// <param name="bReMote">是否远程</param>
|
||||
/// <param name="bVerify">是否生成时审核</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/ST/{cCardNum}/Insert/Token")]
|
||||
public async Task<BaseResult<string>> InsertToken(string cCardNum, [FromBody] Dictionary<string, object> input, bool bCheck = true, bool bBeforCheckStock = true, bool bIsRedVouch = false, string sAddedState = "", bool bReMote = false)
|
||||
public async Task<BaseResult<string>> InsertToken(string cCardNum, [FromBody] Dictionary<string, object> input, bool bCheck = true, bool bBeforCheckStock = true, bool bIsRedVouch = false, string sAddedState = "", bool bReMote = false, bool? bVerify = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -468,7 +468,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
var res = await co.Insert(baseLogin, input, cCardNum, voucherInfo.VoucherType, bGetCode, codeKey, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote, voucherInfo.bVerify, voucherInfo.bPrintDom);
|
||||
var res = await co.Insert(baseLogin, input, cCardNum, voucherInfo.VoucherType, bGetCode, codeKey, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote, bVerify??voucherInfo.bVerify, voucherInfo.bPrintDom);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Entity.AA
|
||||
{
|
||||
public class InventoryOutput
|
||||
{
|
||||
public dynamic Inventory { get; set; }
|
||||
|
||||
public dynamic Inventory_Sub { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Entity
|
||||
{
|
||||
public class QuerySelect
|
||||
{
|
||||
public string TableName { get; set; }
|
||||
|
||||
public string FieldName { get; set; }
|
||||
|
||||
public string AsName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,10 @@
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.5.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.VoucherCO_Sa">
|
||||
<HintPath>D:\U8SOFT\Interop\Interop.VoucherCO_Sa.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -413,14 +417,18 @@
|
||||
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
|
||||
<Compile Include="Controllers\CommonController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\U8\AAController.cs" />
|
||||
<Compile Include="Controllers\U8\APController.cs" />
|
||||
<Compile Include="Controllers\U8\DPController.cs" />
|
||||
<Compile Include="Controllers\U8\MOController.cs" />
|
||||
<Compile Include="Controllers\U8\PUController.cs" />
|
||||
<Compile Include="Controllers\U8\SAController.cs" />
|
||||
<Compile Include="Controllers\U8\SFCController.cs" />
|
||||
<Compile Include="Controllers\U8\STController.cs" />
|
||||
<Compile Include="Controllers\U8\WorkflowController.cs" />
|
||||
<Compile Include="Entity\AA\InventoryOutput.cs" />
|
||||
<Compile Include="Entity\LoginInput.cs" />
|
||||
<Compile Include="Entity\QuerySelect.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
@@ -436,6 +444,7 @@
|
||||
<Content Include="App_Data\U8API.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="App_Data\来料报检单模板.json" />
|
||||
<Content Include="Areas\HelpPage\HelpPage.css" />
|
||||
<Content Include="Content\bootstrap-grid.css" />
|
||||
<Content Include="Content\bootstrap-grid.min.css" />
|
||||
@@ -487,11 +496,19 @@
|
||||
<Content Include="App_Data\API_Meta.db">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="App_Data\采购入库单模板.json" />
|
||||
<Content Include="App_Data\票据录入模板.json" />
|
||||
<Content Include="App_Data\请购单模板.json" />
|
||||
<Content Include="App_Data\销售订单模板.json" />
|
||||
<Content Include="App_Data\订单报工模板.json" />
|
||||
<Content Include="App_Data\Customer.json" />
|
||||
<None Include="App_Data\采购入库单模板.json" />
|
||||
<None Include="App_Data\票据录入模板.json" />
|
||||
<None Include="App_Data\请购单模板.json" />
|
||||
<Content Include="App_Data\销售发票模板.json" />
|
||||
<None Include="App_Data\销售订单模板.json" />
|
||||
<None Include="App_Data\订单报工模板.json" />
|
||||
<Content Include="App_Data\Inventory.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="App_Data\MO21.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Oracle.DataAccess.Common.Configuration.Section.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Interop.UAPvouchercontrol130;
|
||||
using Interop.UAPvouchercontrol85;
|
||||
using Microsoft.VisualBasic;
|
||||
|
||||
namespace VoucherPlugTest
|
||||
|
||||
Reference in New Issue
Block a user