Compare commits
10
Commits
b2121a1afb
...
86cb7a2eba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86cb7a2eba | ||
|
|
070537d147 | ||
|
|
42e6579447 | ||
|
|
8208ba7488 | ||
|
|
fac128c7f4 | ||
|
|
4d48bbf980 | ||
|
|
5def74f70a | ||
|
|
858538df17 | ||
|
|
864e17ceda | ||
|
|
0720f7a904 |
@@ -0,0 +1,25 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Common.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统U8账套对接参数配置表
|
||||
/// </summary>
|
||||
[SugarTable("SysU8AccountConfig", "系统U8账套对接参数配置表")]
|
||||
public class SysSubSystem
|
||||
{
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "主键", ColumnName = "Id", IsNullable = false)]
|
||||
public virtual long Id { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "应用秘钥",ColumnName = "AppSecrtet")]
|
||||
public virtual string AppSecrtet { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "应用key",ColumnName = "AppKey")]
|
||||
public virtual string AppKey { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace UFIDA.U8.Framework.Api.Common.Entity
|
||||
{
|
||||
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "主键", ColumnName = "Id", IsNullable = false)]
|
||||
public int Id { get; set; }
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统号
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Entity\SysSubSystem.cs" />
|
||||
<Compile Include="Entity\SysU8AccountConfig.cs" />
|
||||
<Compile Include="Entity\SysU8FieldDefine.cs" />
|
||||
<Compile Include="Entity\SysU8MTask.cs" />
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.AA
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础资料
|
||||
/// </summary>
|
||||
public class IClsCommon
|
||||
{
|
||||
public async Task<BaseResult<string>> Add(BaseLogin baseLogin,string cCardNum,Dictionary<string,object> input)
|
||||
{
|
||||
var com = "U8SrvTrans.IClsCommon".GetComObject();
|
||||
|
||||
com.InitNew(baseLogin._vbLogin);
|
||||
|
||||
var xml = $@"<fitem citem_class=""04"" citem_name=""testjxc"" citem_text=""项目名称"" crule=""1"" ctable=""fitemss04"" cClasstable=""fitemss04class"">
|
||||
<structure>
|
||||
<field citem_sqr=""1"" cfield_name=""i_id"" ctext=""自动编号"" imode=""0"" itype=""1"" ilength =""4"" iscale=""0"" blist=""0"" bsum=""0"" bref=""0"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""2"" cfield_name=""citemcode"" ctext=""项目编号"" imode=""1"" itype=""3"" ilength =""60"" iscale=""0"" blist=""1"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""3"" cfield_name=""citemname"" ctext=""项目名称"" imode=""2"" itype=""3"" ilength =""255"" iscale=""0"" blist=""1"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" /> <field citem_sqr=""4"" cfield_name=""bclose"" ctext=""是否结算"" imode=""3"" itype=""5"" ilength =""1"" iscale=""0"" blist=""0"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""5"" cfield_name=""citemccode"" ctext=""所属分类码"" imode=""4"" itype=""3"" ilength =""22"" iscale=""0"" blist=""0"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""6"" cfield_name=""iotherused"" ctext=""其他系统是否使用"" imode=""5"" itype=""1"" ilength =""4"" iscale=""0"" blist=""0"" bsum=""0"" bref=""0"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
</structure>
|
||||
<itemclass citemccode=""04"" citemcname=""testjxc"" iitemcgrade="""" bitemcend="""" ctable=""fitemss04class""> </itemclass>
|
||||
</fitem>";
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
var smg = "";
|
||||
res.bSuccess = com.Add(xml, "fitem", ref smg);
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
res.result = smg;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.AA.U8PzInsert
|
||||
{
|
||||
public class IFitem
|
||||
{
|
||||
|
||||
public async Task<BaseResult<string>> Transact(BaseLogin baseLogin, string cCardNum, Dictionary<string, object> input)
|
||||
{
|
||||
var com = "U8PzInsert.IFitem".GetComObject();
|
||||
|
||||
//com.InitNew(baseLogin._vbLogin);
|
||||
|
||||
var xml = $@"<ufinterface roottag=""fitem"" docid="""" proc=""Add"" billtype="""" receiver="""" sender="""" codeexchanged="""" exportneedexch="""">
|
||||
<fitem citem_class=""04"" citem_name=""testjxc"" citem_text=""项目名称"" crule=""1"">
|
||||
<structure>
|
||||
<field citem_sqr=""1"" cfield_name=""i_id"" ctext=""自动编号"" imode=""0"" itype=""1"" ilength =""4"" iscale=""0"" blist=""0"" bsum=""0"" bref=""0"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""2"" cfield_name=""citemcode"" ctext=""项目编号"" imode=""1"" itype=""3"" ilength =""60"" iscale=""0"" blist=""1"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""3"" cfield_name=""citemname"" ctext=""项目名称"" imode=""2"" itype=""3"" ilength =""255"" iscale=""0"" blist=""1"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" /> <field citem_sqr=""4"" cfield_name=""bclose"" ctext=""是否结算"" imode=""3"" itype=""5"" ilength =""1"" iscale=""0"" blist=""0"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""5"" cfield_name=""citemccode"" ctext=""所属分类码"" imode=""4"" itype=""3"" ilength =""22"" iscale=""0"" blist=""0"" bsum=""0"" bref=""1"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
<field citem_sqr=""6"" cfield_name=""iotherused"" ctext=""其他系统是否使用"" imode=""5"" itype=""1"" ilength =""4"" iscale=""0"" blist=""0"" bsum=""0"" bref=""0"" isubitem=""0"" idefine="""" bprimarykey=""0"" isource="""" ctablename="""" cfieldname=""0"" iwidth=""1500"" ialign=""1"" />
|
||||
</structure>
|
||||
<itemclass citemccode=""04"" citemcname=""testjxc"" iitemcgrade="""" bitemcend=""""> </itemclass>
|
||||
</fitem>
|
||||
</ufinterface>";
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
var smg = "";
|
||||
smg = com.Transact(xml, baseLogin._vbLogin);
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
res.result = smg;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
|
||||
bodys.Add(body);
|
||||
|
||||
var res2=await clsVouchFacade.SaveVouch(login, newInput, "收款单", true, "cVouchID");
|
||||
var res2=await clsVouchFacade.SaveVouch(login, newInput, "收款单", true,false /*"cVouchID"*/);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
using log4net;
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
{
|
||||
public class clsApplyPayCO
|
||||
{
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
public async Task<BaseResult<string>> SaveVoucher(BaseLogin baseLogin, Dictionary<string, object> input, string SysId = null, bool IsAdd = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
var co = "UFAPApplyPay.clsApplyPayCO".GetComObject();
|
||||
|
||||
var errorMsg = "";
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
co.DoInit(baseLogin._vbLogin, baseLogin.Connection, SysId);
|
||||
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
{
|
||||
public class clsVouchFacade
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 保存单据
|
||||
@@ -30,92 +30,50 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
/// <param name="bPrintDom"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SaveVouch(BaseLogin login, Dictionary<string, object> input,string VouchClass,bool bGetCode=false,string codeKey="",bool bPrintDom=false)
|
||||
public async Task<BaseResult<string>> SaveVouch(BaseLogin baseLogin, Dictionary<string, object> input,string VouchClass,bool IsAdd = true,bool bVerify=false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var clsVouchFacade = $"UFAPBO.clsVouchFacade".GetComObject();
|
||||
var clsVouchFacade = $"UFAPApplyPay.clsVouchFacade".GetComObject();
|
||||
|
||||
clsVouchFacade.Init(VouchClass, login._vbLogin);
|
||||
clsVouchFacade.init(VouchClass, baseLogin._vbLogin, baseLogin.Connection);
|
||||
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
|
||||
var errMsg = "";
|
||||
|
||||
//if (!clsVouchFacade.GetVouchData("0", ref domHead, ref domBody, ref errMsg))
|
||||
//{
|
||||
// throw new Exception(errMsg);
|
||||
//}
|
||||
_logInfo.Debug("填充表头DOM...");
|
||||
|
||||
domHead = input.ToDocument2(domHead);
|
||||
|
||||
if (!input.TryGetValue("body", out var bodys))
|
||||
{
|
||||
await Task.Delay(1);
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
if (!(bodys is List<Dictionary<string, object>> dictionarys) || dictionarys.Count <= 0)
|
||||
{
|
||||
throw new Exception("无法获取表体数据");
|
||||
throw new Exception("无法获取表体数据");
|
||||
}
|
||||
|
||||
//if (bGetCode)
|
||||
//{
|
||||
// var cardNum = "";
|
||||
|
||||
// switch (VouchClass)
|
||||
// {
|
||||
// case "收款单":
|
||||
// cardNum = "AR48";
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
|
||||
// //var clsBillComponent = "UFBillComponent.clsBillComponent".GetComObject();
|
||||
|
||||
// //if (!clsBillComponent.InitBill(login._vbLogin.UfDbName, cardNum))
|
||||
// //{
|
||||
// // throw new Exception("初始化单据编号组件失败");
|
||||
// //}
|
||||
|
||||
// //var newCode = clsBillComponent.GetNumber(clsBillComponent.GetBillFormat());
|
||||
|
||||
// var newCode = "0000000001";
|
||||
|
||||
// logInfo.Debug($"获取新单号:{newCode}");
|
||||
|
||||
// if (!string.IsNullOrWhiteSpace(newCode))
|
||||
// {
|
||||
// CommonHelper.SetDomKeyValue(domHead, codeKey, newCode);
|
||||
// }
|
||||
|
||||
// input[codeKey] = newCode;
|
||||
//}
|
||||
|
||||
logInfo.Debug("填充表体DOM...");
|
||||
_logInfo.Debug("填充表体DOM...");
|
||||
domBody = dictionarys.ToDocument2(domBody);
|
||||
|
||||
if (bPrintDom)
|
||||
{
|
||||
logInfo.Debug("开始输入DOM...");
|
||||
|
||||
logInfo.Debug(domHead.xml);
|
||||
|
||||
logInfo.Debug(domBody.xml);
|
||||
}
|
||||
|
||||
var res = new BaseResult<string>();
|
||||
|
||||
res.bSuccess = clsVouchFacade.SaveVouch(domHead, domBody, ref errMsg);
|
||||
res.bSuccess = clsVouchFacade.SaveVouch(domHead, domBody, ref errMsg, IsAdd);
|
||||
|
||||
if (!res.bSuccess)
|
||||
{
|
||||
throw new Exception(errMsg);
|
||||
}
|
||||
|
||||
if (bVerify)
|
||||
{
|
||||
clsVouchFacade.Verify();
|
||||
}
|
||||
|
||||
res.message = "保存成功";
|
||||
res.voucherCode = "";
|
||||
res.voucherId = "";
|
||||
@@ -127,7 +85,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.AP
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
|
||||
@@ -13,28 +13,31 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
public class BEHelper
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
protected readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
private readonly dynamic _be;
|
||||
private readonly PropertyInfo[] _props;
|
||||
private string _invCode;
|
||||
private string _free1;
|
||||
private string _free2;
|
||||
private string _free3;
|
||||
private string _free4;
|
||||
private string _free5;
|
||||
private string _free6;
|
||||
private string _free7;
|
||||
private string _free8;
|
||||
private string _free9;
|
||||
private string _free10;
|
||||
private string _invCode="";
|
||||
private string _free1 = "";
|
||||
private string _free2 = "";
|
||||
private string _free3 = "";
|
||||
private string _free4 = "";
|
||||
private string _free5 = "";
|
||||
private string _free6 = "";
|
||||
private string _free7 = "";
|
||||
private string _free8 = "";
|
||||
private string _free9 = "";
|
||||
private string _free10 = "";
|
||||
private int _bomVersion;
|
||||
private readonly string _cCardNum;
|
||||
|
||||
public BEHelper(dynamic be)
|
||||
public BEHelper(dynamic be, string cCardNum="")
|
||||
{
|
||||
_be = be;
|
||||
var tp = be.GetType();
|
||||
_props = tp.GetProperties();
|
||||
|
||||
_cCardNum = cCardNum;
|
||||
}
|
||||
|
||||
public void SetValue(Dictionary<string,object> dictionary)
|
||||
@@ -42,7 +45,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
foreach (var key in dictionary.Keys)
|
||||
{
|
||||
if(key != "body")
|
||||
logInfo.Debug($"正在设置字段:{key}--{dictionary[key]}");
|
||||
_logInfo.Debug($"正在设置字段:{key}--{dictionary[key]}");
|
||||
|
||||
if (key.Contains("define") && !key.Contains("chdefine") && !key.Contains("cbdefine"))
|
||||
{
|
||||
@@ -60,7 +63,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
_be.ExtendUserDefineItem[defineCode] = dictionary[key];
|
||||
}
|
||||
} else if (key.Contains("cbdefine"))
|
||||
}
|
||||
else if (key.Contains("cbdefine"))
|
||||
{
|
||||
var defineCode = int.Parse(key.Replace("cbdefine", ""));
|
||||
|
||||
@@ -68,7 +72,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
_be.ExtendUserDefineItem[defineCode] = dictionary[key];
|
||||
}
|
||||
}else if (key.Contains("free"))
|
||||
}
|
||||
else if (key.Contains("free"))
|
||||
{
|
||||
var freeCode = int.Parse(key.Replace("free", ""));
|
||||
|
||||
@@ -80,7 +85,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
if (string.Equals(key, "invCode", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_invCode = $"{dictionary[key]}";
|
||||
}else if (string.Equals(key, "bomversion", StringComparison.OrdinalIgnoreCase))
|
||||
}
|
||||
else if (string.Equals(key, "bomversion", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_bomVersion = int.Parse($"{dictionary[key]}");
|
||||
}
|
||||
@@ -141,5 +147,14 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
_be.SetBomId(_be.PartId, _bomVersion);
|
||||
}
|
||||
|
||||
public void SetMoAllocateId()
|
||||
{
|
||||
if (_cCardNum == "MO39")
|
||||
{
|
||||
_be.SetMoAllocateId(_be.PartId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
using System;
|
||||
using ADODB;
|
||||
using GetComObj;
|
||||
using log4net;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
using ADODB;
|
||||
using GetComObj;
|
||||
using log4net;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using MSXML2;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UFIDA.U8.Framework.Api.Common.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
@@ -89,7 +87,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static dynamic ToVoucherData(this Dictionary<string,object> dict,dynamic obj)
|
||||
public static dynamic ToVoucherData(this Dictionary<string, object> dict, dynamic obj)
|
||||
{
|
||||
foreach (var dictKey in dict.Keys)
|
||||
{
|
||||
@@ -215,7 +213,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
// //}
|
||||
//}
|
||||
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string,object> dictionary,IXMLDOMDocument2 domDocument2=null)
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null)
|
||||
{
|
||||
|
||||
if (domDocument2 == null)
|
||||
@@ -233,7 +231,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
}
|
||||
|
||||
public static IXMLDOMNode SetRowData(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null,string bodyKey="body")
|
||||
public static IXMLDOMNode SetRowData(this Dictionary<string, object> dictionary, IXMLDOMDocument2 domDocument2 = null, string bodyKey = "body")
|
||||
{
|
||||
if (domDocument2 == null)
|
||||
{
|
||||
@@ -244,7 +242,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
foreach (var key in dictionary.Keys)
|
||||
{
|
||||
if(key==bodyKey)
|
||||
if (key == bodyKey)
|
||||
continue;
|
||||
|
||||
var attr = domDocument2.createAttribute(key);
|
||||
@@ -304,16 +302,16 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
return root;
|
||||
}
|
||||
|
||||
public static object SetDomKeyValue(this IXMLDOMDocument2 domDocument2,string key,object value)
|
||||
public static object SetDomKeyValue(this IXMLDOMDocument2 domDocument2, string key, object value)
|
||||
{
|
||||
var node= domDocument2.selectSingleNode("//z:row");
|
||||
var node = domDocument2.selectSingleNode("//z:row");
|
||||
|
||||
if (node == null)
|
||||
return null;
|
||||
|
||||
var attr = domDocument2.createAttribute(key);
|
||||
|
||||
attr.nodeValue=value;
|
||||
attr.nodeValue = value;
|
||||
|
||||
node.attributes.setNamedItem(attr);
|
||||
|
||||
@@ -325,9 +323,9 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
{
|
||||
if (dictionary.ContainsKey(bodyKey))
|
||||
{
|
||||
var body= dictionary[bodyKey].ToJson().ToList<Dictionary<string,object>>();
|
||||
var body = dictionary[bodyKey].ToJson().ToList<Dictionary<string, object>>();
|
||||
|
||||
dictionary[bodyKey] = body;
|
||||
dictionary[bodyKey] = body;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,9 +566,11 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var val = cPrecision == null
|
||||
? dt.Compute(calcFormula, "")
|
||||
: Math.Round(Convert.ToDecimal(dt.Compute(calcFormula, "")), cPrecision ?? 6); //计算公式结果
|
||||
: Math.Round(Convert.ToDecimal(dt.Compute(calcFormula, "")), cPrecision ?? 6, MidpointRounding.AwayFromZero); //计算公式结果
|
||||
|
||||
dict[def.FieldName] = val;
|
||||
|
||||
_logInfo.Debug($"字段:{def.FieldName}公式:{calcFormula},公式结果:{val}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -657,7 +657,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static VouchersInfo GetVouchers(Connection conn,string cCardNum)
|
||||
public static VouchersInfo GetVouchers(Connection conn, string cCardNum)
|
||||
{
|
||||
if (conn == null) throw new ArgumentNullException(nameof(conn));
|
||||
if (cCardNum == null) throw new ArgumentNullException(nameof(cCardNum));
|
||||
@@ -698,7 +698,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
}
|
||||
|
||||
res.cCodeFieldName = codeName;
|
||||
res.voucherIdFieldName= $"{rst.Fields["VchTblPrimarykeyNames"].Value}";
|
||||
res.voucherIdFieldName = $"{rst.Fields["VchTblPrimarykeyNames"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
@@ -713,7 +713,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
/// <param name="vouchers">单据配置信息</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static string GetVoucherCode(Connection conn,object voucherId, VouchersInfo vouchers)
|
||||
public static string GetVoucherCode(Connection conn, object voucherId, VouchersInfo vouchers)
|
||||
{
|
||||
if (conn == null) throw new ArgumentNullException(nameof(conn));
|
||||
if (voucherId == null) throw new ArgumentNullException(nameof(voucherId));
|
||||
@@ -742,6 +742,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
return cCode;
|
||||
|
||||
}
|
||||
@@ -785,6 +787,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var voucherId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
return voucherId;
|
||||
|
||||
}
|
||||
@@ -797,7 +801,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
/// <param name="eventId">事件Id</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static string GetEventId(Connection conn, string cCardNum,string eventId,bool bUAP =false)
|
||||
public static string GetEventId(Connection conn, string cCardNum, string eventId, bool bUAP = false)
|
||||
{
|
||||
if (conn == null) throw new ArgumentNullException(nameof(conn));
|
||||
if (cCardNum == null) throw new ArgumentNullException(nameof(cCardNum));
|
||||
@@ -824,11 +828,13 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
|
||||
var voucherId = rst.Fields["cBizEventId"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
return voucherId;
|
||||
|
||||
}
|
||||
|
||||
public static string GetVoucherWhereSqlByCode(VouchersInfo vouchers,string cVoucherCode)
|
||||
public static string GetVoucherWhereSqlByCode(VouchersInfo vouchers, string cVoucherCode)
|
||||
{
|
||||
var tableName = vouchers.cBTTblName;
|
||||
var fieldName = vouchers.voucherIdFieldName;
|
||||
@@ -864,5 +870,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
|
||||
{
|
||||
public class BaseResult<T>
|
||||
{
|
||||
@@ -12,6 +6,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Entity
|
||||
public string message { get; set; }
|
||||
public string voucherCode { get; set; }
|
||||
public string voucherId { get; set; }
|
||||
public string tradeid { get; set; }
|
||||
public T result { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 令牌构造参数
|
||||
/// </summary>
|
||||
public class UserTokenInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统号
|
||||
/// </summary>
|
||||
public string cAccId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户令牌
|
||||
/// </summary>
|
||||
public string userToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录参数
|
||||
/// </summary>
|
||||
public LoginParamter loginParamter { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -925,5 +925,200 @@ namespace UFIDA.U8.Framework.Api.ControlObject.PU
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量提交工作流(单号)
|
||||
/// </summary>
|
||||
/// <param name="baseLogin"></param>
|
||||
/// <param name="sCardNum"></param>
|
||||
/// <param name="enmVoucherType"></param>
|
||||
/// <param name="cCodes"></param>
|
||||
/// <param name="bPositive"></param>
|
||||
/// <param name="sBillType"></param>
|
||||
/// <param name="sBusType"></param>
|
||||
/// <param name="UserMode"></param>
|
||||
/// <param name="sOverDetailsXml"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<List<BaseResult<string>>> SubmintWf(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);
|
||||
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
var conn = baseLogin.Connection;
|
||||
|
||||
var vouchers = CommonHelper.GetVouchers(conn, sCardNum);
|
||||
|
||||
var resList = new List<BaseResult<string>>();
|
||||
|
||||
foreach (var cCode in cCodes)
|
||||
{
|
||||
try
|
||||
{
|
||||
var strWhere = CommonHelper.GetPUVoucherWhereSqlByCode(vouchers, cCode);
|
||||
|
||||
var curId = CommonHelper.GetVoucherId(conn, cCode, vouchers);
|
||||
|
||||
var verifyResult = await SubmintWf(co, conn, enmVoucherType, cCode, curId, strWhere);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
return resList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量提交工作流(ID)
|
||||
/// </summary>
|
||||
/// <param name="baseLogin"></param>
|
||||
/// <param name="sCardNum"></param>
|
||||
/// <param name="enmVoucherType"></param>
|
||||
/// <param name="vouchIds"></param>
|
||||
/// <param name="bPositive"></param>
|
||||
/// <param name="sBillType"></param>
|
||||
/// <param name="UserMode"></param>
|
||||
/// <param name="sOverDetailsXml"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<List<BaseResult<string>>> SubmintWf(BaseLogin baseLogin, string sCardNum, vouchertype enmVoucherType, List<long> vouchIds, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
var conn = baseLogin.Connection;
|
||||
|
||||
var vouchers = CommonHelper.GetVouchers(conn, sCardNum);
|
||||
|
||||
var resList = new List<BaseResult<string>>();
|
||||
|
||||
foreach (var vouchId in vouchIds)
|
||||
{
|
||||
var strWhere = CommonHelper.GetPUVoucherWhereSqlById(vouchers, vouchId);
|
||||
|
||||
var cCode = CommonHelper.GetVoucherCode(conn, vouchId, vouchers);
|
||||
|
||||
var verifyResult = await SubmintWf(co, conn, enmVoucherType, cCode, vouchId, strWhere);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
}
|
||||
|
||||
return resList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交工作流(单号)
|
||||
/// </summary>
|
||||
/// <param name="baseLogin"></param>
|
||||
/// <param name="sCardNum"></param>
|
||||
/// <param name="enmVoucherType"></param>
|
||||
/// <param name="cCode"></param>
|
||||
/// <param name="bPositive"></param>
|
||||
/// <param name="sBillType"></param>
|
||||
/// <param name="sBusType"></param>
|
||||
/// <param name="UserMode"></param>
|
||||
/// <param name="sOverDetailsXml"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SubmintWf(BaseLogin baseLogin, string sCardNum, vouchertype enmVoucherType, string cCode, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
var conn = baseLogin.Connection;
|
||||
|
||||
var vouchers = CommonHelper.GetVouchers(conn, sCardNum);
|
||||
|
||||
var curId = CommonHelper.GetVoucherId(conn, cCode, vouchers);
|
||||
|
||||
var strWhere = CommonHelper.GetPUVoucherWhereSqlByCode(vouchers, cCode);
|
||||
|
||||
var verifyResult = await SubmintWf(co, conn, enmVoucherType, cCode, curId, strWhere);
|
||||
|
||||
return verifyResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交工作流(ID)
|
||||
/// </summary>
|
||||
/// <param name="baseLogin"></param>
|
||||
/// <param name="sCardNum"></param>
|
||||
/// <param name="enmVoucherType"></param>
|
||||
/// <param name="vouchId"></param>
|
||||
/// <param name="bPositive"></param>
|
||||
/// <param name="sBillType"></param>
|
||||
/// <param name="sBusType"></param>
|
||||
/// <param name="UserMode"></param>
|
||||
/// <param name="sOverDetailsXml"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SubmintWf(BaseLogin baseLogin, string sCardNum, vouchertype enmVoucherType, long vouchId, bool bPositive = true, string sBillType = null, string sBusType = null, UseMode UserMode = UseMode.CS, string sOverDetailsXml = null)
|
||||
{
|
||||
var co = InitCo(baseLogin, enmVoucherType, bPositive, sBillType, sBusType, UserMode, sOverDetailsXml);
|
||||
|
||||
var conn = baseLogin.Connection;
|
||||
|
||||
var vouchers = CommonHelper.GetVouchers(conn, sCardNum);
|
||||
|
||||
var strWhere = CommonHelper.GetPUVoucherWhereSqlById(vouchers, vouchId);
|
||||
|
||||
var cCode = CommonHelper.GetVoucherCode(conn, vouchId, vouchers);
|
||||
|
||||
var verifyResult = await SubmintWf(co, conn, enmVoucherType, cCode, vouchId, strWhere);
|
||||
|
||||
return verifyResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交工作流
|
||||
/// </summary>
|
||||
/// <param name="voucherCO"></param>
|
||||
/// <param name="conn"></param>
|
||||
/// <param name="sVouchType"></param>
|
||||
/// <param name="cCode"></param>
|
||||
/// <param name="vouchId"></param>
|
||||
/// <param name="strWhere"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<BaseResult<string>> SubmintWf(dynamic voucherCO, Connection conn, vouchertype sVouchType, string cCode, object vouchId, string strWhere)
|
||||
{
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug("开始获取单据数据...");
|
||||
voucherCO.GetVoucherData(ref domHead, ref domBody, strWhere);
|
||||
|
||||
var res = new BaseResult<string>
|
||||
{
|
||||
voucherCode = cCode,
|
||||
voucherId = $"{vouchId}"
|
||||
};
|
||||
|
||||
var errorMsg = "";
|
||||
|
||||
voucherCO.SubmintWf(domHead, ref errorMsg, vouchId);
|
||||
|
||||
res.bSuccess = string.IsNullOrWhiteSpace(errorMsg);
|
||||
|
||||
if (res.bSuccess)
|
||||
{
|
||||
res.message = "提交成功";
|
||||
res.result = res.voucherId;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
res.message = "提交失败";
|
||||
res.result = string.IsNullOrWhiteSpace(errorMsg) ? "未知错误" : errorMsg;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,225 @@ 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 = "";
|
||||
|
||||
var oSystem = "USSAServer.clsSystem".GetComObject();
|
||||
|
||||
if (!oSystem.Init(login._vbLogin, ref errorMsg))
|
||||
{
|
||||
throw new Exception($"初始化失败:{errorMsg}");
|
||||
}
|
||||
|
||||
var co = "VoucherCO_Sa.ClsVoucherCO_SA".GetComObject();
|
||||
|
||||
try
|
||||
{
|
||||
co.Init(enmVoucherType: enmVoucherType, oLogin: ref login._vbLogin, oConn: ref login.Connection, sysObj: oSystem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"初始化失败:{ex.Message}");
|
||||
}
|
||||
|
||||
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? bVerify = 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>();
|
||||
|
||||
|
||||
_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}")) ||
|
||||
(errorMsg == "True" && !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 == 0)
|
||||
//{
|
||||
// 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;
|
||||
res.message = "保存成功";
|
||||
|
||||
_logInfo.Debug($"{baseLogin.Connection.State},{baseLogin.Connection.ConnectionString}");
|
||||
|
||||
var strWhere = CommonHelper.GetVoucherWhereSqlById(vouchers, vouchId);
|
||||
|
||||
if (res.bSuccess && bVerify == true)
|
||||
{
|
||||
var verifyRes =await VerifyVouch(co, baseLogin.Connection, enmVoucherType, res.voucherCode, res.voucherId, strWhere, true);
|
||||
|
||||
if (verifyRes.bSuccess == false)
|
||||
{
|
||||
return verifyRes;
|
||||
}
|
||||
}
|
||||
|
||||
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 };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核单据
|
||||
/// </summary>
|
||||
/// <param name="voucherCo"></param>
|
||||
/// <param name="conn"></param>
|
||||
/// <param name="sVouchType"></param>
|
||||
/// <param name="cCode"></param>
|
||||
/// <param name="vouchId"></param>
|
||||
/// <param name="strWhere"></param>
|
||||
/// <param name="bVerify"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<BaseResult<string>> VerifyVouch(dynamic voucherCo, Connection conn, VoucherTypeSA sVouchType, string cCode, object vouchId, string strWhere, bool bVerify)
|
||||
{
|
||||
try
|
||||
{
|
||||
IXMLDOMDocument2 domHead = new DOMDocument();
|
||||
IXMLDOMDocument2 domBody = new DOMDocument();
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug("开始获取单据数据...");
|
||||
voucherCo.GetVoucherData(ref domHead, ref domBody, vouchId, true, "");
|
||||
|
||||
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;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.SA
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.SA
|
||||
{
|
||||
public enum VoucherTypeSA
|
||||
{
|
||||
|
||||
SaleBillSpecBlue = 0,
|
||||
SaleBillSpecRed = 1,
|
||||
SaleBillCommBlue = 2,
|
||||
SaleBillCommRed = 3,
|
||||
SaleBillDirect = 4,
|
||||
SARetailBlue = 5,
|
||||
SARetailRed = 6,
|
||||
SAMoveBlue = 7,
|
||||
SAMoveRed = 8,
|
||||
/// <summary>
|
||||
/// 发货单蓝字
|
||||
/// </summary>
|
||||
DispatchBlue=9,
|
||||
DispatchBlue = 9,
|
||||
DispatchRed = 10,
|
||||
DispatchFIRST = 11,
|
||||
SODetails = 12,
|
||||
ExpenseVouch = 13,
|
||||
SalePayVouch = 14,
|
||||
WTDispatchBlue = 15,
|
||||
WTDispatchRed = 16,
|
||||
EntrustBlue = 17,
|
||||
EntrustRed = 18,
|
||||
WrapLease = 19,
|
||||
WrapLeaseTH = 20,
|
||||
SAQuo = 21,
|
||||
WTTZ = 22,
|
||||
WTDXQC = 23,
|
||||
SaleOutVouch = 24,
|
||||
PurZYBillVouch = 25,
|
||||
PurPTBillVouch = 26,
|
||||
PurYFBillVouch = 27,
|
||||
PurOrderVouch = 28,
|
||||
omOrderVouch = 29,
|
||||
moOrderVouch = 30,
|
||||
MeterOutVouch = 31,
|
||||
FinGdInVouch = 32,
|
||||
PurChInVouch = 33,
|
||||
ReturnsApplyVouch = 34,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ using log4net;
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
@@ -21,7 +24,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
/// </summary>
|
||||
public class USERPCO
|
||||
{
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 新增单据
|
||||
@@ -39,17 +42,18 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
/// <param name="bReMote"></param>
|
||||
/// <param name="bAudit"></param>
|
||||
/// <param name="bPrintDom"></param>
|
||||
/// <param name="bVerify"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> Insert(BaseLogin baseLogin, Dictionary<string, object> dictionary, string cCardNum, string sVouchType, bool bGetCode = false, string codeKey = "", bool bCheck = true, bool bBeforCheckStock = true, bool bIsRedVouch = false, string sAddedState = "", bool bReMote = false, bool bAudit = false, bool bPrintDom = false)
|
||||
public async Task<BaseResult<string>> Insert(BaseLogin baseLogin, Dictionary<string, object> dictionary, string cCardNum, string sVouchType, bool bGetCode = false, string codeKey = "", bool bCheck = true, bool bBeforCheckStock = true, bool bIsRedVouch = false, string sAddedState = "", bool bReMote = false, bool bAudit = false, bool bPrintDom = false,bool bVerify=false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var co = "USERPCO.VoucherCO".GetComObject();
|
||||
|
||||
var errorMsg = "";
|
||||
logInfo.Debug("开始输出登录信息");
|
||||
logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
_logInfo.Debug("开始输出登录信息");
|
||||
_logInfo.Debug(baseLogin._vbLogin.userToken);
|
||||
|
||||
if (!co.IniLogin(baseLogin._vbLogin, ref errorMsg))
|
||||
{
|
||||
@@ -65,21 +69,20 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
try
|
||||
{
|
||||
logInfo.Debug("开始获取单据默认模板...");
|
||||
_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);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error($"获取单据默认模板失败,错误信息:{ex.Message}", ex);
|
||||
_logInfo.Error($"获取单据默认模板失败,错误信息:{ex.Message}", ex);
|
||||
|
||||
errorMsg = "";
|
||||
|
||||
logInfo.Debug($"开始读取单据数据,当前单据编码:{cCardNum}");
|
||||
_logInfo.Debug($"开始读取单据数据,当前单据编码:{cCardNum}");
|
||||
|
||||
if (!co.Load(sVouchType, "1=2", ref domHead, ref domBody, ref domPosition, ref errorMsg, true) || !string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
@@ -88,7 +91,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
}
|
||||
|
||||
logInfo.Debug("填充表头DOM...");
|
||||
_logInfo.Debug("填充表头DOM...");
|
||||
|
||||
domHead = dictionary.ToDocument2(domHead);
|
||||
|
||||
@@ -109,7 +112,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
errorMsg = "";
|
||||
var newCode = co.GetNewVouchCode(sVouchType, domHead, ref errorMsg);
|
||||
|
||||
logInfo.Debug($"获取新单号:{newCode}");
|
||||
_logInfo.Debug($"获取新单号:{newCode}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(newCode))
|
||||
{
|
||||
@@ -117,7 +120,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
}
|
||||
}
|
||||
|
||||
logInfo.Debug("填充表体DOM...");
|
||||
_logInfo.Debug("填充表体DOM...");
|
||||
domBody = dictionarys.ToDocument2(domBody);
|
||||
|
||||
IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
@@ -133,33 +136,33 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
{
|
||||
if (bPrintDom)
|
||||
{
|
||||
logInfo.Debug("开始输入DOM...");
|
||||
_logInfo.Debug("开始输入DOM...");
|
||||
|
||||
logInfo.Debug(domHead.xml);
|
||||
_logInfo.Debug(domHead.xml);
|
||||
|
||||
logInfo.Debug(domBody.xml);
|
||||
_logInfo.Debug(domBody.xml);
|
||||
|
||||
logInfo.Debug(domPosition.xml);
|
||||
_logInfo.Debug(domPosition.xml);
|
||||
}
|
||||
|
||||
logInfo.Debug("执行插入操作...");
|
||||
_logInfo.Debug("执行插入操作...");
|
||||
res.bSuccess = co.Insert(sVouchType, domHead, domBody, null, ref errorMsg, baseLogin.Connection, ref vouchId, ref domMsg, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote);
|
||||
|
||||
if (res.bSuccess)
|
||||
{
|
||||
res.voucherId = $"{vouchId}";
|
||||
logInfo.Debug($"操作完成,操作结果:成功!------[{vouchId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
_logInfo.Debug($"操作完成,操作结果:成功!------[{vouchId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
|
||||
res.voucherCode = CommonHelper.GetVoucherCode(baseLogin.Connection, vouchId, vouchers);
|
||||
|
||||
if (bAudit)
|
||||
{
|
||||
var res2 = co.Verify(sVouchType, vouchId, ref errorMsg, baseLogin.Connection, null, ref domMsg);
|
||||
_logInfo.Debug($"当前单据号:{res.voucherCode},开始审核操作");
|
||||
|
||||
var res2 = co.Verify(sVouchType, vouchId, ref errorMsg, baseLogin.Connection, null, ref domMsg);
|
||||
|
||||
if (!res2)
|
||||
{
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
throw new Exception(errorMsg);
|
||||
|
||||
@@ -169,19 +172,170 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
throw new Exception("审核单据时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
baseLogin.Connection.CommitTrans();
|
||||
_logInfo.Debug($"当前单据号:{res.voucherCode},操作完成,操作结果:成功!------[{vouchId}]------[{errorMsg}]------[{bVerify}]------[{cCardNum}]------[{domMsg.xml}]");
|
||||
|
||||
res.message = "新增成功";
|
||||
|
||||
if (bVerify && cCardNum=="0304")
|
||||
{
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},开始审核其他出入库单据");
|
||||
|
||||
var strSql = $"select ID,cCode,ufts from KCOtherOutH where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='调拨' and cBusCode='{res.voucherCode}'";
|
||||
|
||||
var rst = new Recordset();
|
||||
|
||||
rst.Open(strSql, baseLogin.Connection);
|
||||
|
||||
if (!rst.BOF && !rst.EOF)
|
||||
{
|
||||
var outId = $"{rst.Fields["ID"].Value}";
|
||||
var outCode = $"{rst.Fields["cCode"].Value}";
|
||||
var ufts = $"{rst.Fields["ufts"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
errorMsg = "";
|
||||
domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他出库单:{outCode},开始审核其他出库单");
|
||||
|
||||
var resOut = co.Verify("09", outId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resOut)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
throw new Exception($"审核其他出库单时发生异常,错误信息:{errorMsg}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(domMsg.xml))
|
||||
throw new Exception($"审核其他出库单时发生异常,零出库控制:{domMsg.xml}");
|
||||
|
||||
throw new Exception("审核其他出库单时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他出库单:{outCode},审核其他出库单完成,操作结果:成功!------[{outId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
rst.Close();
|
||||
}
|
||||
|
||||
strSql = $"select ID,cCode,ufts from KCOtherInH where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='调拨' and cBusCode='{res.voucherCode}'";
|
||||
|
||||
var rst2 = new Recordset();
|
||||
|
||||
rst2.Open(strSql, baseLogin.Connection);
|
||||
|
||||
if (!rst2.BOF && !rst2.EOF)
|
||||
{
|
||||
var inId = $"{rst2.Fields["ID"].Value}";
|
||||
var inCode = $"{rst2.Fields["cCode"].Value}";
|
||||
var ufts = $"{rst2.Fields["ufts"].Value}";
|
||||
|
||||
rst2.Close();
|
||||
|
||||
errorMsg = "";
|
||||
domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他入库单:{inId},开始审核其他入库单");
|
||||
|
||||
var resIn = co.Verify("08", inId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resIn)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
throw new Exception($"审核其他入库单时发生异常,错误信息:{errorMsg}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(domMsg.xml))
|
||||
throw new Exception($"审核其他入库单时发生异常,零出库控制:{domMsg.xml}");
|
||||
|
||||
throw new Exception("审核其他入库单时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"0304,当前单据号:{res.voucherCode},其他入库单:{inCode},审核其他入库单完成,操作结果:成功!------[{inId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
rst2.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(bVerify && cCardNum == "0411")
|
||||
{
|
||||
_logInfo.Debug($"0411,当前单据号:{res.voucherCode},开始审核材料出库单");
|
||||
|
||||
var strSql = $"select ID,cCode,ufts from RecordOutQ where (isnull(iverifystate,0)=0 or dVeriDate is null) and cSource='产成品入库单' and cBusCode='{res.voucherCode}'";
|
||||
|
||||
var rst = new Recordset();
|
||||
|
||||
rst.Open(strSql, baseLogin.Connection);
|
||||
|
||||
if (!rst.BOF && !rst.EOF)
|
||||
{
|
||||
var outId = $"{rst.Fields["ID"].Value}";
|
||||
var outCode = $"{rst.Fields["cCode"].Value}";
|
||||
var ufts = $"{rst.Fields["ufts"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
errorMsg = "";
|
||||
domMsg = new DOMDocument();
|
||||
|
||||
_logInfo.Debug($"0411,当前单据号:{res.voucherCode},材料出库单:{outCode},开始审核材料出库单");
|
||||
|
||||
var resOut = co.Verify("11", outId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resOut)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
_logInfo.Error($"第1次审核出错,错误信息:{errorMsg}");
|
||||
|
||||
resOut = co.Verify("11", outId, ref errorMsg, baseLogin.Connection, ufts, ref domMsg);
|
||||
|
||||
if (!resOut)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
throw new Exception($"审核材料出库单时发生异常,错误信息:{errorMsg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(domMsg.xml))
|
||||
throw new Exception($"审核材料出库单时发生异常,零出库控制:{domMsg.xml}");
|
||||
|
||||
throw new Exception("审核材料出库单时发生异常,请检查数据");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"0411,当前单据号:{res.voucherCode},材料出库单:{outCode},审核材料出库单完成,操作结果:成功!------[{outId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
rst.Close();
|
||||
}
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// var strSql = $"UPDATE {vouchers.cBTTblName} SET cHandler = '{dictionary["cmaker"]}' WHERE {vouchers.voucherIdFieldName}={vouchId}";
|
||||
|
||||
// object rsts = new Recordset();
|
||||
|
||||
// baseLogin.Connection.Execute(strSql, out rsts);
|
||||
//}
|
||||
//catch(Exception ex)
|
||||
//{
|
||||
// _logInfo.Error($"更新审核人时发生异常,错误信息:{ex.Message}", ex);
|
||||
//}
|
||||
}
|
||||
|
||||
baseLogin.Connection.CommitTrans();
|
||||
|
||||
res.message = "新增成功";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
logInfo.Debug($"操作完成,操作结果:失败!------[{vouchId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
|
||||
baseLogin.Connection.RollbackTrans();
|
||||
_logInfo.Debug($"操作完成,操作结果:失败!------[{vouchId}]------[{errorMsg}]------[{domMsg.xml}]");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
||||
throw new Exception(errorMsg);
|
||||
@@ -204,7 +358,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -272,13 +426,13 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
|
||||
if (bPrintDom)
|
||||
{
|
||||
logInfo.Debug("开始输入DOM...");
|
||||
_logInfo.Debug("开始输入DOM...");
|
||||
|
||||
logInfo.Debug(domHead.xml);
|
||||
_logInfo.Debug(domHead.xml);
|
||||
|
||||
logInfo.Debug(domBody.xml);
|
||||
_logInfo.Debug(domBody.xml);
|
||||
|
||||
logInfo.Debug(domPosition.xml);
|
||||
_logInfo.Debug(domPosition.xml);
|
||||
}
|
||||
|
||||
//IXMLDOMDocument2 domMsg = new DOMDocument();
|
||||
@@ -319,7 +473,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "新增失败", result = ex.Message };
|
||||
}
|
||||
@@ -394,6 +548,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Verify(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -471,6 +627,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Verify(co, conn, sVouchType, cCode, vouchId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -879,6 +1037,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await UnVerify(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
return verifyResult;
|
||||
@@ -947,6 +1107,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await UnVerify(co, conn, sVouchType, cCode, vouchId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
return verifyResult;
|
||||
@@ -1079,6 +1241,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Delete(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -1156,6 +1320,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
var cCode = $"{rst.Fields["cCode"].Value}";
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Delete(co, conn, sVouchType, cCode, vouchId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
resList.Add(verifyResult);
|
||||
@@ -1226,6 +1392,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.ST
|
||||
rst.MoveFirst();
|
||||
object curId = rst.Fields["ID"].Value;
|
||||
|
||||
rst.Close();
|
||||
|
||||
var verifyResult = await Delete(co, conn, sVouchType, cCode, curId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
return verifyResult;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using ADODB;
|
||||
using ADODB;
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Web.UI.WebControls;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFSoft.U8.Framework.BizBase;
|
||||
using UFSoft.U8.Framework.ContextSrv;
|
||||
@@ -81,20 +82,20 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
/// </summary>
|
||||
public IContextContainer callar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录参数
|
||||
/// </summary>
|
||||
public LoginParamter paramters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化生产制造上下文
|
||||
/// </summary>
|
||||
/// <param name="paramter">登录参数</param>
|
||||
/// <param name="bMon"></param>
|
||||
/// <param name="traceTimes"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public void Init(LoginParamter paramter, bool bMon = true, int traceTimes = 0)
|
||||
public void Init(LoginParamter paramter, bool bMon = true)
|
||||
{
|
||||
|
||||
if (traceTimes > 5)
|
||||
throw new Exception("U8登录异常");
|
||||
|
||||
try
|
||||
{
|
||||
//if (!string.IsNullOrWhiteSpace(ThreadContext.ServerToken))
|
||||
@@ -109,6 +110,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
if (paramter == null) throw new ArgumentNullException(nameof(paramter));
|
||||
|
||||
paramters = paramter;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
|
||||
{
|
||||
Cryptography.m_userToken = "";
|
||||
@@ -126,7 +129,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
|
||||
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}");
|
||||
throw new Exception($"U8登录失败---{_vbLogin.ShareString}");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}");
|
||||
@@ -249,11 +252,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}");
|
||||
@@ -362,12 +382,138 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"重试次数:{traceTimes},错误信息:{ex.Message}", ex);
|
||||
_logInfo.Error($"U8登录失败,错误信息:{ex.Message}", ex);
|
||||
throw;
|
||||
|
||||
Init(paramter, bMon, traceTimes + 1);
|
||||
//Init(paramter, bMon, traceTimes + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化生产制造上下文
|
||||
/// </summary>
|
||||
/// <param name="userToken">令牌</param>
|
||||
/// <param name="bMon"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public void Init(UserTokenInfo userToken, bool bMon = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (userToken == null) throw new ArgumentNullException(nameof(userToken));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Cryptography.m_userToken))
|
||||
{
|
||||
Cryptography.m_userToken = "";
|
||||
}
|
||||
|
||||
userToken.loginParamter.pDate = $"{DateTime.Today:yyyy-MM-dd}";
|
||||
userToken.loginParamter.pYearId = $"{DateTime.Today.Year}";
|
||||
|
||||
paramters = userToken.loginParamter;
|
||||
|
||||
_vbLogin = new VBLogin();
|
||||
_vbLogin.ClearError();
|
||||
|
||||
_logInfo.Debug($"VB--开始进行U8登录:{userToken.userToken}");
|
||||
|
||||
if (!_vbLogin.ConstructLogin(userToken.userToken))
|
||||
{
|
||||
_logInfo.Debug($"VB--U8登录失败,错误信息:{_vbLogin.ShareString}");
|
||||
_logInfo.Debug($"VB--开始重新进行U8登录:{userToken.loginParamter.cSrv}--{userToken.loginParamter.pUserId}--{userToken.loginParamter.pAccId}");
|
||||
|
||||
_vbLogin=new VBLogin();
|
||||
_vbLogin.ClearError();
|
||||
|
||||
|
||||
if (!_vbLogin.Login(userToken.loginParamter.pSubId, userToken.loginParamter.pAccId, userToken.loginParamter.pYearId, userToken.loginParamter.pUserId, userToken.loginParamter.pPassword, userToken.loginParamter.pDate, userToken.loginParamter.cSrv, userToken.loginParamter.cSerial) && string.IsNullOrWhiteSpace(_vbLogin.userToken))
|
||||
{
|
||||
throw new Exception($"U8登录失败---{_vbLogin.ShareString}");
|
||||
}
|
||||
}
|
||||
|
||||
_logInfo.Debug($"VB--开始创建连接对象:{_vbLogin.userToken}");
|
||||
|
||||
Connection = new Connection();
|
||||
Connection.Open(_vbLogin.UfDbName);
|
||||
|
||||
_logInfo.Debug("VB--完成登录进程");
|
||||
|
||||
if (bMon)
|
||||
{
|
||||
|
||||
_logInfo.Debug($"NET--开始进行U8登录:{_vbLogin.userToken}");
|
||||
|
||||
_netLogin = new NetLogin();
|
||||
|
||||
_productContext = _netLogin.Login("DP", _vbLogin.userToken);
|
||||
|
||||
if (_productContext == null)
|
||||
{
|
||||
_logInfo.Debug($"Net--U8上下文构建失败---{_netLogin.ErrDescript}");
|
||||
|
||||
if (!_netLogin.login(userToken.loginParamter.pSubId, userToken.loginParamter.pUserId, userToken.loginParamter.pPassword, userToken.loginParamter.cSrv, userToken.loginParamter.pDate, userToken.loginParamter.pAccId, userToken.loginParamter.cSerial) && string.IsNullOrWhiteSpace(_netLogin.userToken))
|
||||
{
|
||||
#if DEBUG
|
||||
_logInfo.Debug($"Net--使用用户登录--U8上下文构建失败---{_netLogin.ErrDescript}");
|
||||
#else
|
||||
throw new Exception($"Net--U8登录失败---{_netLogin.ErrDescript}");
|
||||
#endif
|
||||
}
|
||||
|
||||
_logInfo.Debug($"Net--开始进行上下文构建:{_netLogin.userToken}");
|
||||
|
||||
_productContext = _netLogin.SubLogin("DP") ?? _netLogin.Login("DP", _vbLogin.userToken);
|
||||
}
|
||||
|
||||
if (_productContext == null)
|
||||
{
|
||||
_logInfo.Debug($"Net--构建上下文--U8上下文构建失败---{_netLogin.ErrDescript}");
|
||||
}
|
||||
|
||||
#region U8 18.0时需要取消注释
|
||||
_logInfo.Debug($"U8M--正在创建应用池:{_netLogin.userToken}");
|
||||
|
||||
var info = U8LoginInfo.CreateInstance(_netLogin.userToken);
|
||||
|
||||
U8LoginInfoPool.Add(_netLogin.userToken, info);
|
||||
|
||||
_logInfo.Debug($"U8M--创建应用池:{info.U8LoginToken}");
|
||||
|
||||
_logInfo.Debug($"U8M--正在设置线程登录信息:{_netLogin.userToken}");
|
||||
ThreadContext.SetLoginInfo(_netLogin.userToken);
|
||||
_logInfo.Debug($"U8M--设置线程登录信息:{_netLogin.userToken}");
|
||||
#endregion
|
||||
|
||||
#region U8 18.0时需要注释
|
||||
|
||||
//_logInfo.Debug($"Net--开始进行上下文刷新:{_productContext.calledContext.token}");
|
||||
|
||||
//ClientUserContext.Instance.RefreshContext();
|
||||
|
||||
#endregion
|
||||
|
||||
_logInfo.Debug("Net--完成生产制造登录进程");
|
||||
|
||||
_logInfo.Debug("Net--构建制造上下文");
|
||||
|
||||
callar = new DefaultContextContainer();
|
||||
|
||||
_logInfo.Debug("Net--构建制造上下文成功");
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"U8登录失败,错误信息:{ex.Message}", ex);
|
||||
throw;
|
||||
|
||||
//Init(paramter, bMon, traceTimes + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化登录信息
|
||||
/// </summary>
|
||||
@@ -726,9 +872,26 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
/// </summary>
|
||||
public void ShutDown()
|
||||
{
|
||||
U8LoginInfoPool.Remove(_netLogin.userToken);
|
||||
try
|
||||
{
|
||||
Connection.Close();
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Connection = null;
|
||||
|
||||
try
|
||||
{
|
||||
U8LoginInfoPool.Remove(_netLogin.userToken);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ThreadContext.ServerToken = null;
|
||||
_vbLogin?.ShutDown();
|
||||
@@ -755,6 +918,27 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
return _vbLogin.get_cAcc_Id() == cAccId;
|
||||
}
|
||||
|
||||
public void ReSetConnection()
|
||||
{
|
||||
if (this.Connection != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Connection = null;
|
||||
}
|
||||
|
||||
Connection=new Connection();
|
||||
|
||||
Connection.Open(_vbLogin.UfDbName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清理登录上下文
|
||||
/// </summary>
|
||||
@@ -767,5 +951,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
_netLogin?.ShutDown();
|
||||
_netLogin = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
{
|
||||
public interface IBaseBF
|
||||
{
|
||||
BaseResult<string> Save(BaseLogin baseLogin,string cCardNum, Dictionary<string, object> input);
|
||||
BaseResult<string> Save(BaseLogin baseLogin,string cCardNum, Dictionary<string, object> input, bool bVerify = false);
|
||||
|
||||
BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, List<Dictionary<string, object>> inputs);
|
||||
BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, List<Dictionary<string, object>> inputs, bool bVerify = false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,436 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFSoft.U8.Framework.BizBase;
|
||||
using UFSoft.U8.Framework.ContextSrv;
|
||||
using UFSoft.U8.U8M.BFDispatcher;
|
||||
using UFSoft.U8.U8M.Common;
|
||||
using UFSoft.U8.U8M.DOSchema.MO;
|
||||
using UFSoft.U8.U8M.Exceptions;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.U8M.MO
|
||||
{
|
||||
/// <summary>
|
||||
/// 补料申请单(MO39)
|
||||
/// </summary>
|
||||
public class ReplenishApply
|
||||
{
|
||||
//日志组件
|
||||
private readonly ILog _logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// 获取空数据源
|
||||
/// </summary>
|
||||
/// <param name="callar"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <returns></returns>
|
||||
private ReplenishApplyDs GetEmptyDs(IContextContainer callar, string cCardNum)
|
||||
{
|
||||
try
|
||||
{
|
||||
_logInfo.Debug($"获取空数据集-----{cCardNum}");
|
||||
|
||||
var ds = MOMExecutor.BFReplenishApply_LoadData("LoadFirst", 0, "", callar);
|
||||
|
||||
if (ds == null)
|
||||
return new ReplenishApplyDs();
|
||||
|
||||
#region 清除数据集里的数据
|
||||
|
||||
_logInfo.Debug("清空数据集-----mom_replenishapplydtl_ExtraDefine");
|
||||
if (ds.Tables.Contains("mom_replenishapplydtl_ExtraDefine"))
|
||||
{
|
||||
ds.Tables["mom_replenishapplydtl_ExtraDefine"].Clear();
|
||||
}
|
||||
|
||||
_logInfo.Debug("清空数据集-----mom_replenishapply_ExtraDefine");
|
||||
|
||||
if (ds.Tables.Contains("mom_replenishapply_ExtraDefine"))
|
||||
{
|
||||
ds.Tables["mom_replenishapply_ExtraDefine"].Clear();
|
||||
}
|
||||
|
||||
_logInfo.Debug("清空数据集-----ReplenishApplyDTL,ReplenishApply");
|
||||
ds.ReplenishApplyDTL.Clear();
|
||||
ds.ReplenishApply.Clear();
|
||||
|
||||
#endregion
|
||||
|
||||
return ds;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 填充DataSet数据
|
||||
/// </summary>
|
||||
/// <param name="callar"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="docNoParam"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
private ReplenishApplyDs GetVoucherDs(IContextContainer callar, string cCardNum, AutoDocNoGenerateParam docNoParam, Dictionary<string, object> input)
|
||||
{
|
||||
|
||||
_logInfo.Debug("获取空数据集");
|
||||
var ds = GetEmptyDs(callar, cCardNum);
|
||||
|
||||
var head = ds.ReplenishApply.NewReplenishApplyRow();
|
||||
|
||||
ds.ReplenishApply.AddReplenishApplyRow(head);
|
||||
|
||||
//_logInfo.Debug($"获取单号规则-----{cCardNum}-----{docNoParam.Paramaters.ToJson()}");
|
||||
//var hsTable = U8MCommonExecutor.BFVoucher_GetVoucherIDFormula(cCardNum, callar);
|
||||
|
||||
//_logInfo.Debug($"获取单号-----{cCardNum}-----{hsTable.ToJson()}");
|
||||
//var docNo = U8MCommonExecutor.BFVoucher_GetVoucherID(cCardNum, hsTable, false, callar);
|
||||
|
||||
var docNo = "";
|
||||
|
||||
_logInfo.Debug("BE处理中");
|
||||
var be = new UFSoft.U8.MO.BE.ReplenishApply(ds);
|
||||
|
||||
be.DocCode = "";
|
||||
|
||||
_logInfo.Debug("填充表头参数");
|
||||
var beHead = new BEHelper(be);
|
||||
|
||||
beHead.SetValue(input);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(be.DocCode))
|
||||
{
|
||||
_logInfo.Debug($"设置单号:{docNo}");
|
||||
be.DocCode = docNo;
|
||||
}
|
||||
|
||||
var bodys = input["body"] as List<Dictionary<string, object>> ?? $"{input["body"]}".ToObject<List<Dictionary<string, object>>>();
|
||||
|
||||
_logInfo.Debug("填充表体参数");
|
||||
for (var i = 0; i < bodys.Count; i++)
|
||||
{
|
||||
var body = bodys[i];
|
||||
var detail = be.ReplenishApplyDTLs[i];
|
||||
|
||||
var beBody = new BEHelper(detail, "MO39");
|
||||
|
||||
beBody.SetValue(body);
|
||||
|
||||
beBody.SetPartId();
|
||||
}
|
||||
|
||||
_logInfo.Debug($"获取数据集:{be.DataObject.ToJson()}");
|
||||
ds = (ReplenishApplyDs)be.DataObject;
|
||||
|
||||
return ds;
|
||||
}
|
||||
|
||||
public BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, Dictionary<string, object> input, bool bVerify = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum, false)
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
|
||||
var ds = GetVoucherDs(callar, cCardNum, docNoParam, input);
|
||||
|
||||
if (ds == null)
|
||||
{
|
||||
throw new Exception("未能构建数据集");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"单据编码:{cCardNum},开始保存");
|
||||
|
||||
var id = MOMExecutor.BFReplenishApply_Save(ds, docNoParam, callar);
|
||||
|
||||
if (id > 0)
|
||||
{
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById", id, "", callar);
|
||||
|
||||
if (bVerify)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
MOMExecutor.BFReplenishApply_ChangeStatus(id, 1, resDs.ReplenishApply[0].Ufts, callar);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"审核时发生异常:{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
_logInfo.Debug($"单据编码:{cCardNum},保存完成,id:{id},单号:{resDs.ReplenishApply[0].DocCode}");
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "保存成功", result = $"{id}", voucherCode = resDs.ReplenishApply[0].DocCode, voucherId = $"{id}" };
|
||||
}
|
||||
|
||||
throw new Exception("保存失败,U8未能返回制单结果");
|
||||
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
catch (TargetInvocationException ex)
|
||||
{
|
||||
if (ex.InnerException is U8MReferenceBENotExistException)
|
||||
{
|
||||
_logInfo.Error(ex.InnerException.Message, ex.InnerException);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.InnerException.Message };
|
||||
}
|
||||
else
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "保存失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> Verify(BaseLogin baseLogin, int voucherId)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (voucherId <= 0)
|
||||
throw new Exception("没有需要审核的数据");
|
||||
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById", voucherId, "", callar);
|
||||
|
||||
MOMExecutor.BFReplenishApply_ChangeStatus(voucherId, 1, resDs.ReplenishApply[0].Ufts, callar);
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "审核成功", result = $"{voucherId}" };
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> Verify(BaseLogin baseLogin, string voucherCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(voucherCode))
|
||||
throw new Exception("没有需要审核的数据");
|
||||
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var voucherId = MOMExecutor.BFReplenishApply_GetIdByCode(voucherCode, callar);
|
||||
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById", voucherId, "", callar);
|
||||
|
||||
MOMExecutor.BFReplenishApply_ChangeStatus(voucherId, 1, resDs.ReplenishApply[0].Ufts, callar);
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "审核成功", result = $"{voucherId}" };
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> UnVerify(BaseLogin baseLogin, int voucherId)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (voucherId <= 0)
|
||||
throw new Exception("没有需要弃审的数据");
|
||||
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById", voucherId, "", callar);
|
||||
|
||||
MOMExecutor.BFReplenishApply_ChangeStatus(voucherId, 2, resDs.ReplenishApply[0].Ufts, callar);
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "弃审成功", result = $"{voucherId}" };
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> UnVerify(BaseLogin baseLogin, string voucherCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(voucherCode))
|
||||
throw new Exception("没有需要审核的数据");
|
||||
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var voucherId = MOMExecutor.BFReplenishApply_GetIdByCode(voucherCode, callar);
|
||||
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById", voucherId, "", callar);
|
||||
|
||||
MOMExecutor.BFReplenishApply_ChangeStatus(voucherId, 2, resDs.ReplenishApply[0].Ufts, callar);
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "弃审成功", result = $"{voucherId}" };
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> Delete(BaseLogin baseLogin, string cCardNum, long voucherId)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (voucherId <= 0)
|
||||
throw new Exception("没有需要删除的数据");
|
||||
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum, false)
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById",(int)voucherId, "", callar);
|
||||
|
||||
if(resDs == null)
|
||||
throw new Exception($"未查询到单据ID为{voucherId}的单据");
|
||||
|
||||
if(resDs.ReplenishApplyDTL!=null && resDs.ReplenishApplyDTL.Count > 0)
|
||||
{
|
||||
for(var i= resDs.ReplenishApplyDTL.Count - 1; i >= 0; i--)
|
||||
{
|
||||
resDs.ReplenishApplyDTL.Rows[i].Delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resDs.ReplenishApply[0].Delete();
|
||||
|
||||
MOMExecutor.BFReplenishApply_Save(resDs, docNoParam, callar);
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "删除成功", result = $"{voucherId}" };
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BaseResult<string> Delete(BaseLogin baseLogin, string cCardNum, string voucherCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(voucherCode))
|
||||
throw new Exception("没有需要删除的数据");
|
||||
|
||||
var callar = new DefaultContextContainer();
|
||||
|
||||
var docNoParam = new AutoDocNoGenerateParam(EnumAutoDocNoType.HandAuto, cCardNum, false)
|
||||
{
|
||||
IsCurrentDocNoByHand = false
|
||||
};
|
||||
|
||||
var voucherId= MOMExecutor.BFReplenishApply_GetIdByCode(voucherCode, callar);
|
||||
|
||||
var resDs = MOMExecutor.BFReplenishApply_LoadData("LoadById", voucherId, "", callar);
|
||||
|
||||
if (resDs == null)
|
||||
throw new Exception($"未查询到单据ID为{voucherId}的单据");
|
||||
|
||||
if (resDs.ReplenishApplyDTL != null && resDs.ReplenishApplyDTL.Count > 0)
|
||||
{
|
||||
for (var i = resDs.ReplenishApplyDTL.Count - 1; i >= 0; i--)
|
||||
{
|
||||
resDs.ReplenishApplyDTL.Rows[i].Delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resDs.ReplenishApply[0].Delete();
|
||||
|
||||
MOMExecutor.BFReplenishApply_Save(resDs, docNoParam, callar);
|
||||
|
||||
return new BaseResult<string> { bSuccess = true, message = "删除成功", result = $"{voucherId}" };
|
||||
}
|
||||
catch (U8MReferenceBENotExistException ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, Dictionary<string, object> input)
|
||||
public BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, Dictionary<string, object> input, bool bVerify = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -213,7 +213,7 @@ namespace UFIDA.U8.Framework.Api.ControlObject.U8M
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="inputs"></param>
|
||||
/// <returns></returns>
|
||||
public BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, List<Dictionary<string, object>> inputs)
|
||||
public BaseResult<string> Save(BaseLogin baseLogin, string cCardNum, List<Dictionary<string, object>> inputs, bool bVerify = false)
|
||||
{
|
||||
|
||||
var idList = new List<int>();
|
||||
|
||||
@@ -89,6 +89,8 @@
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -105,9 +107,11 @@
|
||||
</Reference>
|
||||
<Reference Include="UFIDA.U8.Portal.MTC.Design">
|
||||
<HintPath>D:\U8SOFT\Portal\UFIDA.U8.Portal.MTC.Design.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.BO.BE">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.BO.BE.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.Framework.BE">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.Framework.BE.dll</HintPath>
|
||||
@@ -159,6 +163,10 @@
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.U8M.BE.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.U8M.BF">
|
||||
<HintPath>..\..\..\U8SOFT\U8M\UFSoft.U8.U8M.BF.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UFSoft.U8.U8M.BFDispatcher">
|
||||
<HintPath>D:\U8SOFT\U8M\UFSoft.U8.U8M.BFDispatcher.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
@@ -189,6 +197,9 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AA\IClsCommon.cs" />
|
||||
<Compile Include="AA\U8PzInsert\IFitem.cs" />
|
||||
<Compile Include="AP\clsApplyPayCO.cs" />
|
||||
<Compile Include="AP\clsCloseBil.cs" />
|
||||
<Compile Include="AP\clsVouchFacade.cs" />
|
||||
<Compile Include="AP\Entity\VoucherData.cs" />
|
||||
@@ -200,6 +211,7 @@
|
||||
<Compile Include="Common\CommonHelper.cs" />
|
||||
<Compile Include="Entity\AuditBizEvents.cs" />
|
||||
<Compile Include="Entity\Exch.cs" />
|
||||
<Compile Include="Entity\UserTokenInfo.cs" />
|
||||
<Compile Include="Entity\VouchersInfo.cs" />
|
||||
<Compile Include="Json\JsonHelper.cs" />
|
||||
<Compile Include="Entity\BaseResult.cs" />
|
||||
@@ -217,12 +229,11 @@
|
||||
<Compile Include="U8M\IBaseBF.cs" />
|
||||
<Compile Include="U8M\MOrder.cs" />
|
||||
<Compile Include="U8M\MoRoutingBill.cs" />
|
||||
<Compile Include="U8M\MO\ReplenishApply.cs" />
|
||||
<Compile Include="U8M\StandardBom.cs" />
|
||||
<Compile Include="Workflow\ServiceProxy.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="AA\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
@@ -244,5 +255,8 @@
|
||||
<Name>UFIDA.U8.Framework.Api.Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using log4net;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UFIDA.U8.Audit.ServiceProxy;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
@@ -58,14 +59,26 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Workflow
|
||||
{
|
||||
var auditServiceProxy = new AuditServiceProxy();
|
||||
|
||||
var isWfControled = false;
|
||||
var isWfControled = IsFlowEnabled(login, bizObjectId, eventId);
|
||||
var errMsg = "";
|
||||
|
||||
var res = auditServiceProxy.SubmitApplicationMessage(bizObjectId, eventId, voucherId, login._productContext.calledContext, ref isWfControled, ref errMsg);
|
||||
|
||||
if (!res && !string.IsNullOrWhiteSpace(errMsg))
|
||||
if (isWfControled)
|
||||
{
|
||||
throw new Exception(errMsg);
|
||||
var context = new CalledContext() { subId = "PU", token = login.userToken };
|
||||
|
||||
var res = auditServiceProxy.SubmitApplicationMessage(bizObjectId, eventId, voucherId, context,
|
||||
ref isWfControled, ref errMsg);
|
||||
|
||||
if (!res && !string.IsNullOrWhiteSpace(errMsg))
|
||||
{
|
||||
throw new Exception(errMsg);
|
||||
}
|
||||
|
||||
if (!res)
|
||||
{
|
||||
throw new Exception("审批流发生异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!isWfControled && !string.IsNullOrWhiteSpace(errMsg))
|
||||
@@ -78,12 +91,6 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Workflow
|
||||
throw new Exception("当前单据无法进入工作流");
|
||||
}
|
||||
|
||||
if (!res)
|
||||
{
|
||||
throw new Exception("审批流发生异常");
|
||||
}
|
||||
|
||||
|
||||
return new BaseResult<string>
|
||||
{
|
||||
bSuccess = true,
|
||||
@@ -505,6 +512,98 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Workflow
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// #提交审批流#
|
||||
/// </summary>
|
||||
/// <param name="login"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="voucherCode"></param>
|
||||
/// <param name="bUAP"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessage(BaseLogin login, string cCardNum, string voucherCode, bool bUAP = false)
|
||||
{
|
||||
var voucherId = "";
|
||||
|
||||
try
|
||||
{
|
||||
var vouchers = CommonHelper.GetVouchers(login.Connection, cCardNum);
|
||||
|
||||
voucherId = $"{CommonHelper.GetVoucherId(login.Connection, voucherCode, vouchers)}";
|
||||
|
||||
var bizObjectId = cCardNum;
|
||||
|
||||
if (bUAP)
|
||||
{
|
||||
bizObjectId = $"UAPFORM.{bizObjectId}";
|
||||
}
|
||||
|
||||
return await SubmitResubmitMessage(login, bizObjectId, voucherId, voucherCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"审批流异常:{ex.Message}", ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string>
|
||||
{
|
||||
bSuccess = false,
|
||||
message = "提交失败",
|
||||
voucherCode = voucherCode,
|
||||
voucherId = voucherId,
|
||||
result = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// #提交审批流#
|
||||
/// </summary>
|
||||
/// <param name="login"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="voucherId"></param>
|
||||
/// <param name="bUAP"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessage(BaseLogin login, string cCardNum, object voucherId, bool bUAP = false)
|
||||
{
|
||||
var voucherCode = "";
|
||||
|
||||
try
|
||||
{
|
||||
var vouchers = CommonHelper.GetVouchers(login.Connection, cCardNum);
|
||||
|
||||
voucherCode = $"{CommonHelper.GetVoucherCode(login.Connection, voucherId, vouchers)}";
|
||||
|
||||
var bizObjectId = cCardNum;
|
||||
|
||||
if (bUAP)
|
||||
{
|
||||
bizObjectId = $"UAPFORM.{bizObjectId}";
|
||||
}
|
||||
|
||||
|
||||
return await SubmitResubmitMessage(login, bizObjectId, $"{voucherId}", voucherCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"审批流异常:{ex.Message}", ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<string>
|
||||
{
|
||||
bSuccess = false,
|
||||
message = "提交失败",
|
||||
voucherCode = voucherCode,
|
||||
voucherId = $"{voucherId}",
|
||||
result = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// #取得代办任务#
|
||||
/// </summary>
|
||||
|
||||
@@ -12,4 +12,22 @@
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<basicHttpBinding>
|
||||
<binding name="U8LoginServicesSoap" />
|
||||
<binding name="U8LoginServicesSoap1" />
|
||||
</basicHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://192.168.110.62/U8Application/U8LoginServices.asmx"
|
||||
binding="basicHttpBinding" bindingConfiguration="U8LoginServicesSoap"
|
||||
contract="UFIDA.U8.Framework.Api.U8Service.U8LoginServicesSoap"
|
||||
name="U8LoginServicesSoap" />
|
||||
<endpoint address="http://192.168.110.62/U8Application/U8LoginServices.asmx"
|
||||
binding="basicHttpBinding" bindingConfiguration="U8LoginServicesSoap1"
|
||||
contract="UFIDA.U8.Framework.U8Service.U8LoginServicesSoap"
|
||||
name="U8LoginServicesSoap1" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
</configuration>
|
||||
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,27 @@
|
||||
{
|
||||
"DocCode": "", //补料申请单号
|
||||
"DocDate": "2025-12-13", //单据日期
|
||||
"body": [
|
||||
{
|
||||
"MoSortSeq": 20, //子件行号
|
||||
"MoDId": 1000000102, //生产订单明细Id
|
||||
"OpSeq": "0000", //子件工序行号
|
||||
"InvCode": "01019002063", //存货编码
|
||||
"free1": "", //自由项1
|
||||
"free2": "", //自由项2
|
||||
"free3": "", //自由项3
|
||||
"free4": "", //自由项4
|
||||
"free5": "", //自由项5
|
||||
"free6": "", //自由项6
|
||||
"free7": "", //自由项7
|
||||
"free8": "", //自由项8
|
||||
"free9": "", //自由项9
|
||||
"free10": "", //自由项10
|
||||
"MoAllocateId": 1000001028, //生产订单子件用料表Id
|
||||
"ScrapQty": 100, //报废数量
|
||||
"ApplyQty": 50, //申请数量,不能大于报废数量
|
||||
"DueDate": "2025-12-13", //预计补料日期
|
||||
"ScrapType": 0 //报废类型 1工废/2料废/0其他
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[{"TableName":"Inventory","FieldName":"cInvCCode","AsName":"ParentID"}]
|
||||
@@ -568,6 +568,127 @@
|
||||
<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.ComputationGroup_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="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.BaseLoad(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
基础档案查询
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.AAController.Fitem_Add(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object})">
|
||||
<summary>
|
||||
新增项目大类
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="cCardNum"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.APController">
|
||||
<summary>
|
||||
应收应付管理
|
||||
@@ -615,7 +736,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,22 +805,182 @@
|
||||
<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="M:UFIDA.U8.Framework.Api.Controllers.U8.DPController.InitSubSystem(System.Collections.Generic.Dictionary{System.String,System.String})">
|
||||
<summary>
|
||||
注册子系统
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.DPController.Result(System.String)">
|
||||
<summary>
|
||||
获取接口执行结果
|
||||
</summary>
|
||||
<param name="tradeid"></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.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:表体, L:列表</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_Save(System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean)">
|
||||
<summary>
|
||||
保存补料申请单
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<param name="bVerify"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_SaveToekn(System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean)">
|
||||
<summary>
|
||||
保存补料申请单
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="input"></param>
|
||||
<param name="bVerify"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_Verify(System.String,System.Int32)">
|
||||
<summary>
|
||||
审核补料申请单(ID)
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="voucherId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_VerifyToekn(System.Int32)">
|
||||
<summary>
|
||||
审核补料申请单(ID)
|
||||
</summary>
|
||||
<param name="voucherId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_UnVerify(System.String,System.Int32)">
|
||||
<summary>
|
||||
弃审补料申请单(ID)
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="voucherId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_UnVerifyToekn(System.Int32)">
|
||||
<summary>
|
||||
弃审补料申请单(ID)
|
||||
</summary>
|
||||
<param name="voucherId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_Delete(System.String,System.Int64)">
|
||||
<summary>
|
||||
删除补料申请单(ID)
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="voucherId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_DeleteToekn(System.Int64)">
|
||||
<summary>
|
||||
删除补料申请单(ID)
|
||||
</summary>
|
||||
<param name="voucherId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_Verify(System.String,System.String)">
|
||||
<summary>
|
||||
审核补料申请单(单号)
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="voucherCode"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_VerifyToekn(System.String)">
|
||||
<summary>
|
||||
审核补料申请单(单号)
|
||||
</summary>
|
||||
<param name="voucherCode"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_UnVerify(System.String,System.String)">
|
||||
<summary>
|
||||
弃审补料申请单(单号)
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="voucherCode"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_UnVerifyToekn(System.String)">
|
||||
<summary>
|
||||
弃审补料申请单(单号)
|
||||
</summary>
|
||||
<param name="voucherCode"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_Delete(System.String,System.String)">
|
||||
<summary>
|
||||
删除补料申请单(单号)
|
||||
</summary>
|
||||
<param name="cAccId"></param>
|
||||
<param name="voucherCode"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.MOController.MO39_DeleteToekn(System.String)">
|
||||
<summary>
|
||||
删除补料申请单(单号)
|
||||
</summary>
|
||||
<param name="voucherCode"></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>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.VoucherSave(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.String,System.String,System.Int32,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.VoucherSave(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Boolean,System.String,System.String,System.Int32,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String,System.Nullable{System.Boolean})">
|
||||
<summary>
|
||||
保存单据
|
||||
</summary>
|
||||
@@ -712,10 +993,12 @@
|
||||
<param name="VoucherState">单据状态:2新增,1修改,0非编辑</param>
|
||||
<param name="UserMode">CS 0,BS 1;一般CS</param>
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<param name="tradeid">业务ID</param>
|
||||
<param name="bVerify">是否审核</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Confirm(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Confirm(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
审核单据(单号)
|
||||
</summary>
|
||||
@@ -729,7 +1012,7 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Confirm(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Confirm(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
审核单据(ID)
|
||||
</summary>
|
||||
@@ -757,7 +1040,7 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.CancelConfirm(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.CancelConfirm(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
弃审单据(单号)
|
||||
</summary>
|
||||
@@ -771,7 +1054,7 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.CancelConfirm(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.CancelConfirm(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
弃审单据(ID)
|
||||
</summary>
|
||||
@@ -799,7 +1082,7 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Delete(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Delete(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
删除单据(单号)
|
||||
</summary>
|
||||
@@ -813,7 +1096,7 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Delete(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.Delete(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
删除单据(ID)
|
||||
</summary>
|
||||
@@ -841,6 +1124,103 @@
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.SubmintWf(System.String,System.String,System.String,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
提交工作流(单号)
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="cCode">单号</param>
|
||||
<param name="bPositive">红蓝标识:True,蓝字</param>
|
||||
<param name="sBillType">发票类型(普通发票 ppurbill,专用发票 purbill,运费发票 ypurbill);到货单类型(到货单 0,退货单 1,拒收单 2)</param>
|
||||
<param name="sBusType">业务类型:普通采购,直运采购,受托代销</param>
|
||||
<param name="UserMode">CS 0,BS 1;一般CS</param>
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.SubmintWf(System.String,System.String,System.Int64,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String,System.String)">
|
||||
<summary>
|
||||
提交工作流(ID)
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="voucherId">单据ID</param>
|
||||
<param name="bPositive">红蓝标识:True,蓝字</param>
|
||||
<param name="sBillType">发票类型(普通发票 ppurbill,专用发票 purbill,运费发票 ypurbill);到货单类型(到货单 0,退货单 1,拒收单 2)</param>
|
||||
<param name="sBusType">业务类型:普通采购,直运采购,受托代销</param>
|
||||
<param name="UserMode">CS 0,BS 1;一般CS</param>
|
||||
<param name="sOverDetailsXml">为空</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.PUController.SubmintWf(System.String,System.String,UFIDA.U8.Framework.Api.Models.STInput,System.Boolean,System.String,System.String,UFIDA.U8.Framework.Api.ControlObject.PU.UseMode,System.String)">
|
||||
<summary>
|
||||
提交工作流(批量)
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">报文</param>
|
||||
<param name="bPositive">红蓝标识:True,蓝字</param>
|
||||
<param name="sBillType">发票类型(普通发票 ppurbill,专用发票 purbill,运费发票 ypurbill);到货单类型(到货单 0,退货单 1,拒收单 2)</param>
|
||||
<param name="sBusType">业务类型:普通采购,直运采购,受托代销</param>
|
||||
<param name="UserMode">CS 0,BS 1;一般CS</param>
|
||||
<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:表体, L:列表</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.SAController">
|
||||
<summary>
|
||||
销售管理
|
||||
</summary>
|
||||
</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,System.Nullable{System.Boolean},System.String)">
|
||||
<summary>
|
||||
保存单据
|
||||
</summary>
|
||||
<param name="cAccId">系统号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">报文</param>
|
||||
<param name="VoucherState">单据状态:0新增,1修改</param>
|
||||
<param name="bVerify">是否审核</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.SAController.SaveToken(System.String,System.Collections.Generic.Dictionary{System.String,System.Object},System.Int32,System.Nullable{System.Boolean},System.String)">
|
||||
<summary>
|
||||
保存单据
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="input">报文</param>
|
||||
<param name="VoucherState">单据状态:0新增,1修改</param>
|
||||
<param name="bVerify">是否审核</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.SAController.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:表体, L:列表</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.SFCController">
|
||||
<summary>
|
||||
车间管理
|
||||
@@ -1114,7 +1494,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},System.Nullable{System.Boolean},System.String)">
|
||||
<summary>
|
||||
新增单据
|
||||
</summary>
|
||||
@@ -1126,9 +1506,12 @@
|
||||
<param name="bIsRedVouch">是否红字单据</param>
|
||||
<param name="sAddedState">传空字符串</param>
|
||||
<param name="bReMote">是否远程</param>
|
||||
<param name="bVerify">是否生成时审核</param>
|
||||
<param name="bVerify2"></param>
|
||||
<param name="tradeid">请求ID</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},System.Nullable{System.Boolean},System.String)">
|
||||
<summary>
|
||||
新增单据
|
||||
</summary>
|
||||
@@ -1139,9 +1522,11 @@
|
||||
<param name="bIsRedVouch">是否红字单据</param>
|
||||
<param name="sAddedState">传空字符串</param>
|
||||
<param name="bReMote">是否远程</param>
|
||||
<param name="bVerify">是否生成时审核</param>
|
||||
<param name="bVerify2"></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)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Verify(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.String)">
|
||||
<summary>
|
||||
审核单据(单号)
|
||||
</summary>
|
||||
@@ -1154,7 +1539,7 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Verify(System.String,System.String,System.Int64,System.Boolean,System.Boolean,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Verify(System.String,System.String,System.Int64,System.Boolean,System.Boolean,System.Boolean,System.String)">
|
||||
<summary>
|
||||
审核单据(ID)
|
||||
</summary>
|
||||
@@ -1179,7 +1564,7 @@
|
||||
<param name="bList">是否列表</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.UnVerify(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.UnVerify(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.String)">
|
||||
<summary>
|
||||
弃审单据(单号)
|
||||
</summary>
|
||||
@@ -1192,7 +1577,7 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.UnVerify(System.String,System.String,System.Int64,System.Boolean,System.Boolean,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.UnVerify(System.String,System.String,System.Int64,System.Boolean,System.Boolean,System.Boolean,System.String)">
|
||||
<summary>
|
||||
弃审单据(ID)
|
||||
</summary>
|
||||
@@ -1217,7 +1602,7 @@
|
||||
<param name="bList">是否列表</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Delete(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Delete(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.String)">
|
||||
<summary>
|
||||
删除单据(单号)
|
||||
</summary>
|
||||
@@ -1230,7 +1615,7 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Delete(System.String,System.String,System.Int64,System.Boolean,System.Boolean,System.Boolean)">
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.Delete(System.String,System.String,System.Int64,System.Boolean,System.Boolean,System.Boolean,System.String)">
|
||||
<summary>
|
||||
删除单据(ID)
|
||||
</summary>
|
||||
@@ -1255,6 +1640,17 @@
|
||||
<param name="bList">是否列表</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.STController.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:表体, L:列表</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Controllers.U8.WorkflowController">
|
||||
<summary>
|
||||
审批流
|
||||
@@ -1280,7 +1676,6 @@
|
||||
<summary>
|
||||
提交审批流(单号)
|
||||
</summary>
|
||||
<param name="cAccId">系统注册号</param>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="cCode">单据编号</param>
|
||||
<param name="eventId">审批事件</param>
|
||||
@@ -1309,6 +1704,44 @@
|
||||
<param name="bUap">是否UAP单据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.WorkflowController.SubmitResubmitMessage(System.String,System.String,System.String,System.Boolean)">
|
||||
<summary>
|
||||
退回提交人后重新提交(单号)
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="cCode">单据ID</param>
|
||||
<param name="cAccId">系统注册号</param>
|
||||
<param name="bUap">是否UAP单据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.WorkflowController.SubmitResubmitMessageToken(System.String,System.String,System.Boolean)">
|
||||
<summary>
|
||||
退回提交人后重新提交(单号)
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="cCode">单据编号</param>
|
||||
<param name="bUap">是否UAP单据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.WorkflowController.SubmitResubmitMessage(System.String,System.String,System.Int64,System.Boolean)">
|
||||
<summary>
|
||||
提交审批流(ID)
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="voucherId">单据ID</param>
|
||||
<param name="cAccId">系统注册号</param>
|
||||
<param name="bUap">是否UAP单据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Controllers.U8.WorkflowController.SubmitResubmitMessageToken(System.String,System.Int64,System.Boolean)">
|
||||
<summary>
|
||||
提交审批流(ID)
|
||||
</summary>
|
||||
<param name="cCardNum">单据类型编码</param>
|
||||
<param name="voucherId">单据ID</param>
|
||||
<param name="bUap">是否UAP单据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Entity.LoginInput">
|
||||
<summary>
|
||||
登录参数
|
||||
@@ -1344,14 +1777,9 @@
|
||||
登录输出参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:UFIDA.U8.Framework.Api.Entity.LoginOutput.cAccId">
|
||||
<member name="T:UFIDA.U8.Framework.Api.Entity.SysTradeResult">
|
||||
<summary>
|
||||
系统号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:UFIDA.U8.Framework.Api.Entity.LoginOutput.userToken">
|
||||
<summary>
|
||||
用户令牌
|
||||
接口结果表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.WebApiApplication.CurrentDomain_AssemblyResolve(System.Object,System.ResolveEventArgs)">
|
||||
@@ -1446,6 +1874,16 @@
|
||||
<param name="userToken">用户令牌</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:UFIDA.U8.Framework.Api.Unit.CommUnit.SaveResult(System.String,System.Boolean,UFIDA.U8.Framework.Api.ControlObject.Entity.BaseResult{System.String})">
|
||||
<summary>
|
||||
保存请求结果
|
||||
</summary>
|
||||
<param name="tradeid"></param>
|
||||
<param name="bRun"></param>
|
||||
<param name="result"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="T:UFIDA.U8.Framework.Api.Unit.RemoteLoader">
|
||||
<summary>
|
||||
跨域加载
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ddate": "2025-05-25",
|
||||
"ccode": "0000000009",
|
||||
"cmaker": "demo",
|
||||
"ivtid": 30963,
|
||||
"btaxcost": 0,
|
||||
"isupplytype": 1,
|
||||
"body": [
|
||||
{
|
||||
"operationtype": "0",
|
||||
"cvencode": "01005",
|
||||
"cinvcode": "01019002068",
|
||||
"dstartdate": "2025-05-25T00:00:00",
|
||||
"bsales": 0,
|
||||
"fminquantity": 0.0,
|
||||
"iunitprice": 1.0,
|
||||
"itaxrate": 17.0,
|
||||
"itaxunitprice": 1.17,
|
||||
"cexch_name": "人民币",
|
||||
"bendpricelist": 0,
|
||||
"ivouchrowno": 1,
|
||||
"ipricediff": 1.17
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
{
|
||||
"dlid": 1000000107,
|
||||
"cbustype": "普通销售",
|
||||
"cvouchtype": "05",
|
||||
"cvouchname": "发货单",
|
||||
"cstcode": "01",
|
||||
"cstname": "普通销售",
|
||||
"ddate": "2025-09-02",
|
||||
"cdepcode": "0301",
|
||||
"cdepname": "市场部",
|
||||
"cpersoncode": "00024",
|
||||
"cpersonname": "刘天达",
|
||||
"csocode": "0000000001",
|
||||
"ccuscode": "00000001",
|
||||
"ccusabbname": "世纪天华",
|
||||
"csccode": "04",
|
||||
"cscname": "汽车",
|
||||
"cexch_name": "人民币",
|
||||
"iexchrate": 1.000000000000000e+000,
|
||||
"itaxrate": 0.000000000000000e+000,
|
||||
"breturnflag": 0,
|
||||
"cmaker": "demo",
|
||||
"bfirst": false,
|
||||
"ccusname": "世纪天华集团公司",
|
||||
"body": [
|
||||
{
|
||||
"cwhname": "成品库",
|
||||
"cwhcode": "04",
|
||||
"cinvcode": "W1000A002",
|
||||
"cinvname": "三星打印机",
|
||||
"cinvm_unit": "台",
|
||||
"igrouptype": 0,
|
||||
"cgroupcode": "01",
|
||||
"iquantity": 50.0000000000,
|
||||
"iquotedprice": 1200.0000000000,
|
||||
"itaxunitprice": 1200.0000000000,
|
||||
"iunitprice": 1200.0000000000,
|
||||
"imoney": 60000.0000,
|
||||
"itax": 0.0000,
|
||||
"idiscount": 0.0000,
|
||||
"inatunitprice": 1200.0000000000,
|
||||
"inatmoney": 60000.0000,
|
||||
"inattax": 0.0000,
|
||||
"inatsum": 60000.0000,
|
||||
"inatdiscount": 0.0000,
|
||||
"isum": 60000.0000,
|
||||
"kl": 100.0000000000,
|
||||
"kl2": 100.0000000000,
|
||||
"itaxrate": 0.0000000000,
|
||||
"isosid": 1000000001,
|
||||
"csocode": "0000000001",
|
||||
"dkl1": 0.0000000000,
|
||||
"dkl2": 0.0000000000
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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,297 @@
|
||||
{
|
||||
"ivouchstate": "",
|
||||
"csysbarcode": "",
|
||||
"ccurrentauditor": "",
|
||||
"ivtid": "17",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,9 +6,9 @@
|
||||
"cexch_name": "人民币", //币种
|
||||
"cmaker": "demo", //制单人
|
||||
"breturnflag": 0, //退货标志
|
||||
"cstcode": "", //销售类型编码
|
||||
"cdepcode": "", //部门编码
|
||||
"ccuscode": "", //客户编码
|
||||
"cstcode": "01", //销售类型编码
|
||||
"cdepcode": "0301", //部门编码
|
||||
"ccuscode": "00000001", //客户编码
|
||||
"dpredatebt": "2025-01-01", //预发货日期
|
||||
"dpremodatebt": "2025-01-01", //预完工日期
|
||||
"iexchrate": 1, //汇率
|
||||
@@ -16,12 +16,15 @@
|
||||
"cpersoncode": "", //业务员编码
|
||||
"body": [
|
||||
{
|
||||
"cinvcode": "", //存货编码
|
||||
"cinvcode": "W1000A002", //存货编码
|
||||
"iquantity": 10, //数量
|
||||
"dpredate": "2025-01-01", //预发货日期
|
||||
"dpremodate": "2025-01-01", //预完工日期
|
||||
"editprop": "A", //编辑属性
|
||||
"irowno": 1, //行号
|
||||
"cinvm_unit": "台",
|
||||
"igrouptype": 0,
|
||||
"cgroupcode": "01",
|
||||
"itaxunitprice": 1, //含税单价
|
||||
"iquotedprice": 1, //报价
|
||||
"iunitprice": 1, //无税单价
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace UFIDA.U8.Framework.Api
|
||||
//
|
||||
//c.InjectJavaScript(thisAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testScript1.js");
|
||||
c.InjectJavaScript(Assembly.GetExecutingAssembly(), "UFIDA.U8.Framework.Api.Scripts.Swagger_zh-cn.js");
|
||||
|
||||
c.DisableValidator();
|
||||
// The swagger-ui renders boolean data types as a dropdown. By default, it provides "true" and "false"
|
||||
// strings as the possible choices. You can use this option to change these to something else,
|
||||
// for example 0 and 1.
|
||||
|
||||
@@ -0,0 +1,490 @@
|
||||
using log4net;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.AA;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.AA.U8PzInsert;
|
||||
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.Unit;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础资料
|
||||
/// </summary>
|
||||
public class AAController : 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/AA/Inventory/Load")]
|
||||
public async Task<BaseResult<dynamic>> Inventory_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Inventory", "" },
|
||||
{ "Inventory_Sub", "Inventory_Sub.cInvSubCode=Inventory.cInvCode" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Inventory", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询计量单位档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/ComputationUnit/Load")]
|
||||
public async Task<BaseResult<dynamic>> ComputationUnit_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "ComputationUnit", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "ComputationUnit", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询计量单位组档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/ComputationGroup/Load")]
|
||||
public async Task<BaseResult<dynamic>> ComputationGroup_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "ComputationGroup", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "ComputationGroup", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询部门档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/Department/Load")]
|
||||
public async Task<BaseResult<dynamic>> Department_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Department", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Department", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询仓库档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/Warehouse/Load")]
|
||||
public async Task<BaseResult<dynamic>> Warehouse_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Warehouse", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Warehouse", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询存货分类档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/InventoryClass/Load")]
|
||||
public async Task<BaseResult<dynamic>> InventoryClass_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "InventoryClass", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "InventoryClass", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询供应商档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/Vendor/Load")]
|
||||
public async Task<BaseResult<dynamic>> Vendor_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Vendor", "" },
|
||||
//{ "VendorClass", "VendorClass.cVCCode = Vendor.cVCCode" },
|
||||
//{ "DistrictClass", "DistrictClass.cDCCode = Vendor.cDCCode" },
|
||||
//{ "Person", "Person.cPersonCode = dbo.Vendor.cVenPPerson" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Vendor", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询供应商分类档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/VendorClass/Load")]
|
||||
public async Task<BaseResult<dynamic>> VendorClass_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "VendorClass", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "VendorClass", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询客户档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/Customer/Load")]
|
||||
public async Task<BaseResult<dynamic>> Customer_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Customer", "" },
|
||||
//{ "CustomerClass", "Customer.cCCCode = CustomerClass.cCCCode" },
|
||||
//{ "DistrictClass", "DistrictClass.cDCCode = Customer.cDCCode" },
|
||||
//{ "DistrictClass", "DistrictClass.cDCCode = Customer.cDCCode" },
|
||||
//{ "Person", "Person.cPersonCode = Customer.cCusPerson" },
|
||||
//{ "Warehouse", "Warehouse.cWhCode = Customer.cCusWhCode" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Customer", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询客户分类档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/CustomerClass/Load")]
|
||||
public async Task<BaseResult<dynamic>> CustomerClass_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "CustomerClass", "" },
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "CustomerClass", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询人员档案
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/Person/Load")]
|
||||
public async Task<BaseResult<dynamic>> Person_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "hr_hi_person", "" },
|
||||
//{ "Department", "Department.cDepCode = hr_hi_person.cDept_num" }
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Person", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询标准工序资料
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/Operation/Load")]
|
||||
public async Task<BaseResult<dynamic>> Operation_Load(string cAccId, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
var dict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "sfc_operation", "" }
|
||||
};
|
||||
|
||||
return await BaseLoad(cAccId, "Operation", dict, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基础档案查询
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<BaseResult<dynamic>> BaseLoad(string cAccId, string tableName, Dictionary<string, string> tables, [FromBody] Dictionary<string, object> input = null)
|
||||
{
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
try
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----档案:{tableName},操作:查询,对接账套:{cAccId},条件:{input.ToJson()}");
|
||||
|
||||
if (tables == null || tables.Count == 0)
|
||||
{
|
||||
throw new Exception("未指定档案表");
|
||||
}
|
||||
|
||||
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,
|
||||
IsAutoCloseConnection = true,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsWithNoLockQuery = true
|
||||
}
|
||||
});
|
||||
|
||||
var colList = new Dictionary<string, string>();
|
||||
|
||||
var query = db.Queryable<dynamic>();
|
||||
var bFirst = true;
|
||||
|
||||
foreach (var table in tables)
|
||||
{
|
||||
if (!db.DbMaintenance.IsAnyTable(table.Key))
|
||||
{
|
||||
throw new Exception($"表:{table.Key}不存在");
|
||||
}
|
||||
|
||||
var cols = db.DbMaintenance.GetColumnInfosByTableName(table.Key);
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols.Where(col => !colList.Any(a => string.Equals(a.Key, col.DbColumnName, StringComparison.CurrentCultureIgnoreCase))))
|
||||
{
|
||||
colList.Add(col.DbColumnName, $"{table.Key}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
|
||||
if (bFirst)
|
||||
{
|
||||
query.AS(table.Key, table.Key);
|
||||
bFirst = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
query.AddJoinInfo(table.Key, table.Key, table.Value);
|
||||
}
|
||||
}
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
var conModels = new List<IConditionalModel>();
|
||||
|
||||
foreach (var o in input)
|
||||
{
|
||||
if ($"{o.Value}".EndsWith("%") || $"{o.Value}".StartsWith("%"))
|
||||
{
|
||||
if (colList.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colList.First(a =>
|
||||
string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.Like,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (o.Key.EndsWith("__2"))
|
||||
{
|
||||
if (colList.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colList.First(a =>
|
||||
string.Equals(a.Key, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(a.Value, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
if (colList.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colList.First(a =>
|
||||
string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (colList.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colList.First(a =>
|
||||
string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = col.Value,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
query.Where(conModels);
|
||||
}
|
||||
|
||||
if (colList != null && colList.Keys.Count > 0)
|
||||
{
|
||||
var selector = colList
|
||||
.Select(col => new SelectModel { FieldName = $"{col.Value}", AsName = col.Key }).ToList();
|
||||
|
||||
query.Select(selector);
|
||||
}
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----输出查询语句:{query.ToSqlString()}");
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "查询成功", result = await query.ToListAsync() };
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error($"作业Id:{workId}-----错误信息:{ex.Message}", ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增项目大类
|
||||
/// </summary>
|
||||
/// <param name="cAccId"></param>
|
||||
/// <param name="cCardNum"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/AA/{cCardNum}/Add")]
|
||||
public async Task<BaseResult<string>> Fitem_Add(string cAccId, string cCardNum, [FromBody] Dictionary<string, object> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{cAccId},数据:{input.ToJson()}");
|
||||
|
||||
//LoginParamter param;
|
||||
|
||||
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 co = new IFitem();
|
||||
|
||||
var res = await co.Transact(baseLogin, "", null);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
using System;
|
||||
using log4net;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Description;
|
||||
using System.Web.UI.WebControls;
|
||||
using log4net;
|
||||
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;
|
||||
@@ -11,6 +14,7 @@ using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Entity;
|
||||
using UFIDA.U8.Framework.Api.Models;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
using SysU8AccountConfig = UFIDA.U8.Framework.Api.ControlObject.Entity.SysU8AccountConfig;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
@@ -22,7 +26,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 +40,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();
|
||||
|
||||
@@ -54,7 +59,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
pDate = string.IsNullOrWhiteSpace(input.pDate) ? $"{DateTime.Today:yyyy-MM-dd}" : input.pDate,
|
||||
pPassword = string.IsNullOrWhiteSpace(input.pPassword) ? "" : CommUnit.GetDecrypt(input.pPassword),
|
||||
pYearId = string.IsNullOrWhiteSpace(input.pDate) ? $"{DateTime.Today.Year}" : $"{DateTime.Parse(input.pDate).Year}",
|
||||
pSubId = "DP",
|
||||
pSubId = "DP",
|
||||
pUserId = input.pUserId
|
||||
};
|
||||
|
||||
@@ -81,7 +86,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 +95,6 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// U8登录接口
|
||||
/// </summary>
|
||||
@@ -103,7 +107,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 +127,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);
|
||||
|
||||
@@ -131,7 +135,6 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取U8密码
|
||||
/// </summary>
|
||||
@@ -149,7 +152,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 +179,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 +203,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 +227,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 +262,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 +273,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 +309,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 +320,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 +347,196 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册子系统
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/DP/InitSubSystem")]
|
||||
public async Task<BaseResult<long>> InitSubSystem(Dictionary<string, string> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!input.TryGetValue("cAppInfo", out var cValue) || string.IsNullOrWhiteSpace(cValue))
|
||||
{
|
||||
throw new Exception("参数错误");
|
||||
}
|
||||
var info = CommUnit.GetDecrypt(cValue).ToObject<SysSubSystem>();
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
if (await db.Queryable<SysSubSystem>().AnyAsync(a => a.AppKey == info.AppKey))
|
||||
{
|
||||
throw new Exception("当前子系统已注册");
|
||||
}
|
||||
|
||||
info.Id = SnowFlakeSingle.instance.NextId();
|
||||
|
||||
await db.Insertable(info).ExecuteCommandAsync();
|
||||
|
||||
return new BaseResult<long>() { bSuccess = true, message = "注册成功", result = info.Id };
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
return new BaseResult<long>() { bSuccess = false, message = "子系统初始化失败", result = 0 };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取接口执行结果
|
||||
/// </summary>
|
||||
/// <param name="tradeid"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/AA/Result")]
|
||||
[Route("api/U8/AP/Result")]
|
||||
[Route("api/U8/DP/Result")]
|
||||
[Route("api/U8/MO/Result")]
|
||||
[Route("api/U8/PU/Result")]
|
||||
[Route("api/U8/SA/Result")]
|
||||
[Route("api/U8/SFC/Result")]
|
||||
[Route("api/U8/SF/Result")]
|
||||
[Route("api/U8/ST/Result")]
|
||||
[Route("api/U8/Workflow/Result")]
|
||||
public async Task<BaseResult<string>> Result(string tradeid)
|
||||
{
|
||||
try
|
||||
{
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var entity = await db.Queryable<SysTradeResult>().Where(a=>a.cTradeId==tradeid).FirstAsync();
|
||||
|
||||
if (entity==null)
|
||||
{
|
||||
throw new Exception($"未能找到请求ID:{tradeid}的结果");
|
||||
}
|
||||
|
||||
if (entity.bRun == true)
|
||||
{
|
||||
throw new Exception($"请求ID:{tradeid}正在执行");
|
||||
}
|
||||
|
||||
return entity.cResult;
|
||||
|
||||
} catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string>() { bSuccess = false, message = ex.Message, result = ex.Message };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,625 @@
|
||||
using log4net;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
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.SA;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售管理
|
||||
/// </summary>
|
||||
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>
|
||||
/// <param name="bVerify">是否审核</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, bool? bVerify = null, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Request.Headers.TryGetValues("userToken", out var values))
|
||||
{
|
||||
return await SaveToken(cCardNum, input, VoucherState, bVerify);
|
||||
}
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_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,
|
||||
bVerify ?? voucherInfo.bVerify, voucherInfo.iswfcontrolled, voucherInfo.cFlowFieldName);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
var res = new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存单据
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">报文</param>
|
||||
/// <param name="VoucherState">单据状态:0新增,1修改</param>
|
||||
/// <param name="bVerify">是否审核</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[Route("api/U8/SA/{cCardNum}/Save/Token")]
|
||||
public async Task<BaseResult<string>> SaveToken(string cCardNum, [FromBody] Dictionary<string, object> input, int VoucherState = 0, bool? bVerify = null, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
var userToken = Request.Headers.GetValues("userToken").First();
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/SA/{cCardNum}/Insert/{userToken},参数:{input.ToJson()}");
|
||||
|
||||
var output = CommUnit.GetDecrypt(userToken).ToObject<UserTokenInfo>();
|
||||
|
||||
var token = CommUnit.GetDecrypt(output.userToken);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{output.cAccId},数据:{input.ToJson()}");
|
||||
|
||||
var baseLogin = new BaseLogin();
|
||||
|
||||
baseLogin.Init(output, false);
|
||||
|
||||
_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,
|
||||
bVerify ?? voucherInfo.bVerify, voucherInfo.iswfcontrolled, voucherInfo.cFlowFieldName);
|
||||
|
||||
baseLogin.ShutDown();
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
var res = new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询特定单据部分
|
||||
/// </summary>
|
||||
/// <param name="cAccId">系统号</param>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <param name="cCardPostion">查询所属区域 H:表头,B:表体, L:列表</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[Route("api/U8/SA/{cCardNum}/Load")]
|
||||
[Route("api/U8/SA/{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,
|
||||
IsAutoCloseConnection = true,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsWithNoLockQuery = true
|
||||
}
|
||||
});
|
||||
|
||||
var cBTQName = vouchers.cBTQName;
|
||||
var cBWQName = vouchers.cBWQName;
|
||||
|
||||
var cBTTblExtName = $"{vouchers.cBTTblName}_extradefine";
|
||||
var cBWTblExtName = $"{vouchers.cBWTblName}_extradefine";
|
||||
|
||||
var voucherIdFieldName = vouchers.voucherIdFieldName;
|
||||
var vouchersIdFieldName = "";
|
||||
|
||||
var bExtHead = false;
|
||||
var bExtBody = false;
|
||||
|
||||
var colList = new Dictionary<string, string>();
|
||||
var colListHead = new Dictionary<string, string>();
|
||||
var colListBody = new Dictionary<string, string>();
|
||||
|
||||
var cols = db.DbMaintenance.GetColumnInfosByTableName(cBTQName);
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols.Where(col => !colList.ContainsKey(col.DbColumnName.ToLower())))
|
||||
{
|
||||
if (cCardPostion == "H" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBTQName}.[{col.DbColumnName}]");
|
||||
|
||||
colListHead.Add(col.DbColumnName.ToLower(), $"{cBTQName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable($"{cBTTblExtName}"))
|
||||
{
|
||||
bExtHead = true;
|
||||
|
||||
var extcols = db.DbMaintenance.GetColumnInfosByTableName($"{cBTTblExtName}");
|
||||
|
||||
if (extcols != null && extcols.Count > 0)
|
||||
{
|
||||
foreach (var col in extcols.Where(col => !colList.ContainsKey(col.DbColumnName.ToLower())))
|
||||
{
|
||||
if (cCardPostion == "H" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBTTblExtName}.[{col.DbColumnName}]");
|
||||
|
||||
colListHead.Add(col.DbColumnName.ToLower(), $"{cBTTblExtName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cols = db.DbMaintenance.GetColumnInfosByTableName(cBWQName);
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols.Where(col => !colList.ContainsKey(col.DbColumnName.ToLower())))
|
||||
{
|
||||
if (cCardPostion == "B" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBWQName}.[{col.DbColumnName}]");
|
||||
|
||||
colListBody.Add(col.DbColumnName.ToLower(), $"{cBWQName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable(cBWTblExtName))
|
||||
{
|
||||
bExtBody = true;
|
||||
|
||||
var extcols = db.DbMaintenance.GetColumnInfosByTableName($"{cBWTblExtName}");
|
||||
|
||||
if (extcols != null && extcols.Count > 0)
|
||||
{
|
||||
foreach (var col in extcols)
|
||||
{
|
||||
if (colList.ContainsKey(col.DbColumnName.ToLower()))
|
||||
{
|
||||
vouchersIdFieldName = col.DbColumnName.ToLower();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cCardPostion == "B" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBWTblExtName}.[{col.DbColumnName}]");
|
||||
|
||||
colListBody.Add(col.DbColumnName.ToLower(), $"{cBWTblExtName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var cDefWhere = vouchers.cDefWhere;
|
||||
|
||||
var query = db.Queryable<dynamic>().AS(cBTQName, cBTQName);
|
||||
|
||||
if (bExtHead)
|
||||
{
|
||||
query.AddJoinInfo(cBTTblExtName, cBTTblExtName, $"{cBTQName}.[{voucherIdFieldName}]={cBTTblExtName}.[{voucherIdFieldName}]");
|
||||
}
|
||||
|
||||
query.AddJoinInfo(cBWQName, cBWQName, $"{cBTQName}.[{voucherIdFieldName}]={cBWQName}.[{voucherIdFieldName}]");
|
||||
|
||||
if (bExtBody)
|
||||
{
|
||||
query.AddJoinInfo(cBWTblExtName, cBWTblExtName, $"{cBWQName}.[{vouchersIdFieldName}]={cBWTblExtName}.[{vouchersIdFieldName}]");
|
||||
}
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
var conModels = new List<IConditionalModel>();
|
||||
|
||||
foreach (var o in input)
|
||||
{
|
||||
if (o.Key == "dModifyDate")
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, "dverifysystime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dverifysystime", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, "dverifysystime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dverifysystime", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (o.Key == "dModifyDate__2")
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, "dverifysystime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dverifysystime", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, "dverifysystime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dverifysystime", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if ($"{o.Value}".EndsWith("%") || $"{o.Value}".StartsWith("%"))
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.Like,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.Like,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (o.Key.EndsWith("__2"))
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = col.Value,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = col.Value,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
query.Where(conModels);
|
||||
}
|
||||
|
||||
query.Where(cDefWhere);
|
||||
|
||||
|
||||
var selector = colList.Select(col => new SelectModel { FieldName = $"{col.Value}", AsName = col.Key }).ToList();
|
||||
|
||||
query.Select(selector).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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -14,7 +12,6 @@ using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.ST;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Entity;
|
||||
using UFIDA.U8.Framework.Api.Models;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
// ReSharper disable StringLiteralTypo
|
||||
@@ -46,17 +43,32 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <param name="bIsRedVouch">是否红字单据</param>
|
||||
/// <param name="sAddedState">传空字符串</param>
|
||||
/// <param name="bReMote">是否远程</param>
|
||||
/// <param name="bVerify">是否生成时审核</param>
|
||||
/// <param name="bVerify2"></param>
|
||||
/// <param name="tradeid">请求ID</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, bool? bVerify2 = null, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Request.Headers.TryGetValues("userToken", out var values))
|
||||
{
|
||||
return await InsertToken(cCardNum, input, bCheck, bBeforCheckStock, bIsRedVouch, sAddedState, bReMote, bVerify, bVerify2);
|
||||
}
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{cAccId},数据:{input.ToJson()}");
|
||||
|
||||
//LoginParamter param;
|
||||
@@ -89,7 +101,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
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 defs = await db.Queryable<SysU8FieldDefine>().Where(s => s.CardNumber == cCardNum && s.cPosition == "H" && s.bEnable == true).ToListAsync(); //查询表头字段配置,供后续设置字段值
|
||||
|
||||
var dateKey = "";
|
||||
var exchKey = "";
|
||||
@@ -124,7 +136,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
var bGetCode = false;
|
||||
var codeKey = "";
|
||||
|
||||
if (defs.Any(a => a.bDefault == true && a.cPosition == "H" && a.DefaultValue == "单号" && a.bEnable==true))
|
||||
if (defs.Any(a => a.bDefault == true && a.cPosition == "H" && a.DefaultValue == "单号" && a.bEnable == true))
|
||||
{
|
||||
bGetCode = true;
|
||||
codeKey = defs
|
||||
@@ -163,7 +175,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
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 defsBody = await db.Queryable<SysU8FieldDefine>().Where(s => s.CardNumber == cCardNum && s.cPosition == "B" && s.bEnable == true).ToListAsync(); //获取表体的字段配置
|
||||
|
||||
var rowNo = 1;
|
||||
|
||||
@@ -244,7 +256,11 @@ 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, bVerify2 ?? false);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -252,7 +268,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,10 +289,12 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <param name="bIsRedVouch">是否红字单据</param>
|
||||
/// <param name="sAddedState">传空字符串</param>
|
||||
/// <param name="bReMote">是否远程</param>
|
||||
/// <param name="bVerify">是否生成时审核</param>
|
||||
/// <param name="bVerify2"></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, bool? bVerify2 = null, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -278,7 +302,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/ST/{cCardNum}/Insert/{userToken},参数:{input.ToJson()}");
|
||||
|
||||
var output = CommUnit.GetDecrypt(userToken).ToObject<LoginOutput>();
|
||||
var output = CommUnit.GetDecrypt(userToken).ToObject<UserTokenInfo>();
|
||||
|
||||
var token = CommUnit.GetDecrypt(output.userToken);
|
||||
|
||||
@@ -286,28 +310,18 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{output.cAccId},数据:{input.ToJson()}");
|
||||
|
||||
//LoginParamter param;
|
||||
var baseLogin = new BaseLogin();
|
||||
|
||||
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{userToken}_{output.cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
baseLogin.Init(token, false, 5);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{userToken}_{output.cAccId}", baseLogin);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// param = await CommUnit.GetLoginParamter(cAccId);
|
||||
//}
|
||||
baseLogin.Init(output, false);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----登录信息获取完成,缓存设置完成,开始加载单据配置信息");
|
||||
|
||||
@@ -468,7 +482,13 @@ 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, bVerify2 ?? false);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
baseLogin.ShutDown();
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -476,7 +496,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,7 +740,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[Route("api/U8/ST/{cCardNum}/Verify/Code")]
|
||||
public async Task<BaseResult<string>> Verify(string cAccId, string cCardNum,string cCode, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false)
|
||||
public async Task<BaseResult<string>> Verify(string cAccId, string cCardNum, string cCode, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -722,11 +748,18 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},单号:{cCode}");
|
||||
|
||||
//LoginParamter param;
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin) || baseLogin ==null)
|
||||
if (!_cache.TryGetValue($"U8_{cAccId}", out BaseLogin baseLogin) || baseLogin == null)
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
@@ -756,13 +789,25 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
return await co.Verify(baseLogin, cCardNum, voucherInfo.VoucherType, cCode, bCheck, bBeforCheckStock, bList);
|
||||
var res = await co.Verify(baseLogin, cCardNum, voucherInfo.VoucherType, cCode, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -779,7 +824,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[Route("api/U8/ST/{cCardNum}/Verify/ID")]
|
||||
public async Task<BaseResult<string>> Verify(string cAccId, string cCardNum, long voucherId, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false)
|
||||
public async Task<BaseResult<string>> Verify(string cAccId, string cCardNum, long voucherId, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -787,6 +832,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:审核,对接账套:{cAccId},ID:{voucherId}");
|
||||
|
||||
//LoginParamter param;
|
||||
@@ -821,13 +873,25 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
return await co.Verify(baseLogin, cCardNum, voucherInfo.VoucherType, voucherId, bCheck, bBeforCheckStock, bList);
|
||||
var res = await co.Verify(baseLogin, cCardNum, voucherInfo.VoucherType, voucherId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = "审核失败", result = ex.Message };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -860,7 +924,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var voucherIds = input.voucherId;
|
||||
|
||||
if ((cCodes == null || cCodes.Count<=0) && (voucherIds == null || voucherIds.Count <= 0))
|
||||
if ((cCodes == null || cCodes.Count <= 0) && (voucherIds == null || voucherIds.Count <= 0))
|
||||
{
|
||||
throw new Exception("没有数据需要审核");
|
||||
}
|
||||
@@ -948,7 +1012,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[Route("api/U8/ST/{cCardNum}/UnVerify/Code")]
|
||||
public async Task<BaseResult<string>> UnVerify(string cAccId, string cCardNum,string cCode, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false)
|
||||
public async Task<BaseResult<string>> UnVerify(string cAccId, string cCardNum, string cCode, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -956,6 +1020,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},单号:{cCode}");
|
||||
|
||||
//LoginParamter param;
|
||||
@@ -990,13 +1061,25 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
return await co.UnVerify(baseLogin, cCardNum, voucherInfo.VoucherType, cCode, bCheck, bBeforCheckStock, bList);
|
||||
var res = await co.UnVerify(baseLogin, cCardNum, voucherInfo.VoucherType, cCode, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1014,7 +1097,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[Route("api/U8/ST/{cCardNum}/UnVerify/ID")]
|
||||
public async Task<BaseResult<string>> UnVerify(string cAccId, string cCardNum, long voucherId, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false)
|
||||
public async Task<BaseResult<string>> UnVerify(string cAccId, string cCardNum, long voucherId, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1022,6 +1105,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:弃审,对接账套:{cAccId},ID:{voucherId}");
|
||||
|
||||
//LoginParamter param;
|
||||
@@ -1056,13 +1146,25 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
return await co.UnVerify(baseLogin, cCardNum, voucherInfo.VoucherType, voucherId, bCheck, bBeforCheckStock, bList);
|
||||
var res = await co.UnVerify(baseLogin, cCardNum, voucherInfo.VoucherType, voucherId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = "弃审失败", result = ex.Message };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1095,7 +1197,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var voucherIds = input.voucherId;
|
||||
|
||||
if ((cCodes == null || cCodes.Count<=0) && (voucherIds == null || voucherIds.Count <= 0))
|
||||
if ((cCodes == null || cCodes.Count <= 0) && (voucherIds == null || voucherIds.Count <= 0))
|
||||
{
|
||||
throw new Exception("没有数据需要弃审");
|
||||
}
|
||||
@@ -1183,7 +1285,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[Route("api/U8/ST/{cCardNum}/Delete/Code")]
|
||||
public async Task<BaseResult<string>> Delete(string cAccId, string cCardNum,string cCode, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false)
|
||||
public async Task<BaseResult<string>> Delete(string cAccId, string cCardNum, string cCode, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1191,6 +1293,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},单号:{cCode}");
|
||||
|
||||
//LoginParamter param;
|
||||
@@ -1225,13 +1334,25 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
return await co.Delete(baseLogin, cCardNum, voucherInfo.VoucherType, cCode, bCheck, bBeforCheckStock, bList);
|
||||
var res = await co.Delete(baseLogin, cCardNum, voucherInfo.VoucherType, cCode, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1249,7 +1370,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[Route("api/U8/ST/{cCardNum}/Delete/ID")]
|
||||
public async Task<BaseResult<string>> Delete(string cAccId, string cCardNum, long voucherId, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false)
|
||||
public async Task<BaseResult<string>> Delete(string cAccId, string cCardNum, long voucherId, bool bCheck = true, bool bBeforCheckStock = true, bool bList = false, string tradeid = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1257,6 +1378,13 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tradeid))
|
||||
{
|
||||
tradeid = $"{workId}";
|
||||
}
|
||||
|
||||
await CommUnit.SaveResult(tradeid, true);
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:删除,对接账套:{cAccId},ID:{voucherId}");
|
||||
|
||||
//LoginParamter param;
|
||||
@@ -1291,13 +1419,25 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var co = new USERPCO();
|
||||
|
||||
return await co.UnVerify(baseLogin, cCardNum, voucherInfo.VoucherType, voucherId, bCheck, bBeforCheckStock, bList);
|
||||
var res = await co.UnVerify(baseLogin, cCardNum, voucherInfo.VoucherType, voucherId, bCheck, bBeforCheckStock, bList);
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
var res = new BaseResult<string> { bSuccess = false, message = "删除失败", result = ex.Message };
|
||||
|
||||
res.tradeid = tradeid;
|
||||
|
||||
await CommUnit.SaveResult(tradeid, false, res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1330,7 +1470,7 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
var voucherIds = input.voucherId;
|
||||
|
||||
if ((cCodes == null || cCodes.Count<=0) && (voucherIds == null || voucherIds.Count <= 0))
|
||||
if ((cCodes == null || cCodes.Count <= 0) && (voucherIds == null || voucherIds.Count <= 0))
|
||||
{
|
||||
throw new Exception("没有数据需要删除");
|
||||
}
|
||||
@@ -1405,6 +1545,324 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询特定单据部分
|
||||
/// </summary>
|
||||
/// <param name="cAccId">系统号</param>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <param name="cCardPostion">查询所属区域 H:表头,B:表体, L:列表</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[Route("api/U8/ST/{cCardNum}/Load")]
|
||||
[Route("api/U8/ST/{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,
|
||||
IsAutoCloseConnection = true,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsWithNoLockQuery = true
|
||||
}
|
||||
});
|
||||
|
||||
var cBTQName = vouchers.cBTQName;
|
||||
var cBWQName = vouchers.cBWQName;
|
||||
|
||||
var cBTTblExtName = $"{vouchers.cBTTblName}_extradefine";
|
||||
var cBWTblExtName = $"{vouchers.cBWTblName}_extradefine";
|
||||
|
||||
var voucherIdFieldName = vouchers.voucherIdFieldName;
|
||||
var vouchersIdFieldName = "";
|
||||
|
||||
var bExtHead = false;
|
||||
var bExtBody = false;
|
||||
|
||||
var colList = new Dictionary<string, string>();
|
||||
var colListHead = new Dictionary<string, string>();
|
||||
var colListBody = new Dictionary<string, string>();
|
||||
|
||||
var cols = db.DbMaintenance.GetColumnInfosByTableName(cBTQName);
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols.Where(col => !colList.ContainsKey(col.DbColumnName.ToLower())))
|
||||
{
|
||||
if (cCardPostion == "H" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBTQName}.[{col.DbColumnName}]");
|
||||
|
||||
colListHead.Add(col.DbColumnName.ToLower(), $"{cBTQName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable($"{cBTTblExtName}"))
|
||||
{
|
||||
bExtHead = true;
|
||||
|
||||
var extcols = db.DbMaintenance.GetColumnInfosByTableName($"{cBTTblExtName}");
|
||||
|
||||
if (extcols != null && extcols.Count > 0)
|
||||
{
|
||||
foreach (var col in extcols.Where(col => !colList.ContainsKey(col.DbColumnName.ToLower())))
|
||||
{
|
||||
if (cCardPostion == "H" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBTTblExtName}.[{col.DbColumnName}]");
|
||||
|
||||
colListHead.Add(col.DbColumnName.ToLower(), $"{cBTTblExtName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cols = db.DbMaintenance.GetColumnInfosByTableName(cBWQName);
|
||||
|
||||
if (cols != null && cols.Count > 0)
|
||||
{
|
||||
foreach (var col in cols.Where(col => !colList.ContainsKey(col.DbColumnName.ToLower())))
|
||||
{
|
||||
if (cCardPostion == "B" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBWQName}.[{col.DbColumnName}]");
|
||||
|
||||
colListBody.Add(col.DbColumnName.ToLower(), $"{cBWQName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
|
||||
if (db.DbMaintenance.IsAnyTable(cBWTblExtName))
|
||||
{
|
||||
bExtBody = true;
|
||||
|
||||
var extcols = db.DbMaintenance.GetColumnInfosByTableName($"{cBWTblExtName}");
|
||||
|
||||
if (extcols != null && extcols.Count > 0)
|
||||
{
|
||||
foreach (var col in extcols)
|
||||
{
|
||||
if (colList.ContainsKey(col.DbColumnName.ToLower()))
|
||||
{
|
||||
vouchersIdFieldName = col.DbColumnName.ToLower();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cCardPostion == "B" || cCardPostion == "L")
|
||||
colList.Add(col.DbColumnName.ToLower(), $"{cBWTblExtName}.[{col.DbColumnName}]");
|
||||
|
||||
colListBody.Add(col.DbColumnName.ToLower(), $"{cBWTblExtName}.[{col.DbColumnName}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var cDefWhere = vouchers.cDefWhere;
|
||||
|
||||
var query = db.Queryable<dynamic>().AS(cBTQName, cBTQName);
|
||||
|
||||
if (bExtHead)
|
||||
{
|
||||
query.AddJoinInfo(cBTTblExtName, cBTTblExtName, $"{cBTQName}.[{voucherIdFieldName}]={cBTTblExtName}.[{voucherIdFieldName}]");
|
||||
}
|
||||
|
||||
query.AddJoinInfo(cBWQName, cBWQName, $"{cBTQName}.[{voucherIdFieldName}]={cBWQName}.[{voucherIdFieldName}]");
|
||||
|
||||
if (bExtBody)
|
||||
{
|
||||
query.AddJoinInfo(cBWTblExtName, cBWTblExtName, $"{cBWQName}.[{vouchersIdFieldName}]={cBWTblExtName}.[{vouchersIdFieldName}]");
|
||||
}
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
var conModels = new List<IConditionalModel>();
|
||||
|
||||
foreach (var o in input)
|
||||
{
|
||||
if (o.Key == "dModifyDate")
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, "dnverifytime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dnverifytime", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, "dnverifytime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dnverifytime", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (o.Key == "dModifyDate__2")
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, "dnverifytime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dnverifytime", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, "dnverifytime", StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, "dnverifytime", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if ($"{o.Value}".EndsWith("%") || $"{o.Value}".StartsWith("%"))
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.Like,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.Like,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (o.Key.EndsWith("__2"))
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key.Replace("__2", ""), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.LessThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (input.ContainsKey($"{o.Key}__2"))
|
||||
{
|
||||
if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
|
||||
if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = $"{col.Value}",
|
||||
ConditionalType = ConditionalType.GreaterThanOrEqual,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (colListHead.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListHead.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = col.Value,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
else if (colListBody.Any(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var col = colListBody.First(a => string.Equals(a.Key, o.Key, StringComparison.OrdinalIgnoreCase) || string.Equals(a.Value, o.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
conModels.Add(new ConditionalModel
|
||||
{
|
||||
FieldName = col.Value,
|
||||
ConditionalType = ConditionalType.Equal,
|
||||
FieldValue = $"{o.Value}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
query.Where(conModels);
|
||||
}
|
||||
|
||||
query.Where(cDefWhere);
|
||||
|
||||
|
||||
var selector = colList.Select(col => new SelectModel { FieldName = $"{col.Value}", AsName = col.Key }).ToList();
|
||||
|
||||
query.Select(selector).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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,8 +53,6 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/Workflow/SubmitApplicationMessage/Code,对接账套:{cAccId},单据:{cCardNum},事件:{eventId},单据编号:{cCode}");
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:提交审批流,对接账套:{cAccId},单据编号:{cCode}");
|
||||
@@ -95,7 +93,6 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
/// <summary>
|
||||
/// 提交审批流(单号)
|
||||
/// </summary>
|
||||
/// <param name="cAccId">系统注册号</param>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="cCode">单据编号</param>
|
||||
/// <param name="eventId">审批事件</param>
|
||||
@@ -177,8 +174,6 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
return await SubmitApplicationMessageToken(cCardNum, voucherId, eventId, bUap);
|
||||
}
|
||||
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/Workflow/SubmitApplicationMessage/Code,作业Id:{workId},对接账套:{cAccId},单据:{cCardNum},事件:{eventId},单据ID:{voucherId}");
|
||||
@@ -281,5 +276,246 @@ namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退回提交人后重新提交(单号)
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="cCode">单据ID</param>
|
||||
/// <param name="cAccId">系统注册号</param>
|
||||
/// <param name="bUap">是否UAP单据</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/Workflow/SubmitResubmitMessage/Code")]
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessage(string cAccId, string cCardNum, string cCode, bool bUap = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Request.Headers.TryGetValues("userToken", out var userToken))
|
||||
{
|
||||
return await SubmitResubmitMessageToken(cCardNum, cCode, bUap);
|
||||
}
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/Workflow/SubmitResubmitMessage/Code,对接账套:{cAccId},单据:{cCardNum},单据编号:{cCode}");
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:提交审批流,对接账套:{cAccId},单据编号:{cCode}");
|
||||
|
||||
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, true);
|
||||
|
||||
_cache.Clear();
|
||||
|
||||
_cache.Set($"U8_{cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var services = new ServiceProxy();
|
||||
|
||||
return await services.SubmitResubmitMessage(baseLogin, cCardNum, cCode, bUap);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退回提交人后重新提交(单号)
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="cCode">单据编号</param>
|
||||
/// <param name="bUap">是否UAP单据</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/Workflow/SubmitResubmitMessage/Code/Token")]
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessageToken(string cCardNum, string cCode, bool bUap = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var userToken = Request.Headers.GetValues("userToken").First();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(userToken))
|
||||
{
|
||||
throw new Exception("校验userToken失败");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/Workflow/SubmitResubmitMessage/Code/{userToken},单据:{cCardNum},单据编号:{cCode}");
|
||||
|
||||
var output = CommUnit.GetDecrypt(userToken).ToObject<LoginOutput>();
|
||||
|
||||
var token = CommUnit.GetDecrypt(output.userToken);
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{output.cAccId},单据编号:{cCode}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{userToken}_{output.cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
baseLogin.Init(token, true, 5);
|
||||
|
||||
try
|
||||
{
|
||||
_cache.Remove($"U8_{userToken}_{output.cAccId}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logInfo.Debug($"不存在[U8_{userToken}_{output.cAccId}]的缓存");
|
||||
}
|
||||
|
||||
_cache.Set($"U8_{userToken}_{output.cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var services = new ServiceProxy();
|
||||
|
||||
return await services.SubmitResubmitMessage(baseLogin, cCardNum, cCode, bUap);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交审批流(ID)
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="voucherId">单据ID</param>
|
||||
/// <param name="cAccId">系统注册号</param>
|
||||
/// <param name="bUap">是否UAP单据</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/Workflow/SubmitResubmitMessage/ID")]
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessage(string cAccId, string cCardNum, long voucherId, bool bUap = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Request.Headers.TryGetValues("userToken", out var userToken))
|
||||
{
|
||||
return await SubmitResubmitMessageToken(cCardNum, voucherId, bUap);
|
||||
}
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/Workflow/SubmitApplicationMessage/Code,作业Id:{workId},对接账套:{cAccId},单据:{cCardNum},单据ID:{voucherId}");
|
||||
|
||||
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 services = new ServiceProxy();
|
||||
|
||||
return await services.SubmitResubmitMessage(baseLogin, cCardNum, voucherId, bUap);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交审批流(ID)
|
||||
/// </summary>
|
||||
/// <param name="cCardNum">单据类型编码</param>
|
||||
/// <param name="voucherId">单据ID</param>
|
||||
/// <param name="bUap">是否UAP单据</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/Workflow/SubmitResubmitMessage/ID/Token")]
|
||||
public async Task<BaseResult<string>> SubmitResubmitMessageToken(string cCardNum, long voucherId, bool bUap = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var userToken = Request.Headers.GetValues("userToken").First();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(userToken))
|
||||
{
|
||||
throw new Exception("校验userToken失败");
|
||||
}
|
||||
|
||||
_logInfo.Debug($"当前接口:api/U8/Workflow/SubmitApplicationMessage/ID/{userToken},单据:{cCardNum},单据ID:{voucherId}");
|
||||
|
||||
var output = CommUnit.GetDecrypt(userToken).ToObject<LoginOutput>();
|
||||
|
||||
var token = CommUnit.GetDecrypt(output.userToken);
|
||||
|
||||
var workId = SnowFlakeSingle.Instance.NextId();
|
||||
|
||||
_logInfo.Debug($"作业Id:{workId}-----单据:{cCardNum},操作:新增,对接账套:{output.cAccId},单据ID:{voucherId}");
|
||||
|
||||
if (!_cache.TryGetValue($"U8_{userToken}_{output.cAccId}", out BaseLogin baseLogin))
|
||||
{
|
||||
_logInfo.Debug($"作业Id:{workId}-----未获取到缓存的登录信息,正在重新构建");
|
||||
|
||||
baseLogin = new BaseLogin();
|
||||
|
||||
baseLogin.Init(token, true, 5);
|
||||
|
||||
try
|
||||
{
|
||||
_cache.Remove($"U8_{userToken}_{output.cAccId}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logInfo.Debug($"不存在[U8_{userToken}_{output.cAccId}]的缓存");
|
||||
}
|
||||
|
||||
_cache.Set($"U8_{userToken}_{output.cAccId}", baseLogin);
|
||||
}
|
||||
|
||||
var services = new ServiceProxy();
|
||||
|
||||
return await services.SubmitResubmitMessage(baseLogin, cCardNum, voucherId, bUap);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = ex.Message, result = ex.StackTrace };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,21 +42,8 @@ namespace UFIDA.U8.Framework.Api.Entity
|
||||
/// <summary>
|
||||
/// 登录输出参数
|
||||
/// </summary>
|
||||
public class LoginOutput
|
||||
public class LoginOutput:UserTokenInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统号
|
||||
/// </summary>
|
||||
public string cAccId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户令牌
|
||||
/// </summary>
|
||||
public string userToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录参数
|
||||
/// </summary>
|
||||
public LoginParamter loginParamter { 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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Entity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 接口结果表
|
||||
/// </summary>
|
||||
[SugarTable("SysTradeResult", "接口结果表")]
|
||||
public class SysTradeResult
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键", ColumnName = "Id", IsNullable = false)]
|
||||
public virtual long Id { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "交易唯一识别码", ColumnName = "cTradeId", Length = 100, IsNullable = false)]
|
||||
public virtual string cTradeId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "是否正在运行", ColumnName = "bRun", IsNullable = true)]
|
||||
public virtual bool? bRun { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "结果", ColumnName = "cResult", IsJson = true, IsNullable = true)]
|
||||
public virtual BaseResult<string> cResult { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "开始时间", ColumnName = "dStartDate", IsNullable = true)]
|
||||
public virtual DateTime? dStartDate { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "结束时间", ColumnName = "dEndDate", IsNullable = true)]
|
||||
public virtual DateTime? dEndDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ namespace UFIDA.U8.Framework.Api
|
||||
private readonly string s_u8FrameworkPath;
|
||||
private readonly string s_u8APIFramework;
|
||||
private readonly string s_u8workflow;
|
||||
private readonly string s_u8BusinessNotify;
|
||||
|
||||
|
||||
public WebApiApplication()
|
||||
@@ -29,6 +30,7 @@ namespace UFIDA.U8.Framework.Api
|
||||
s_u8FrameworkPath = $@"{s_u8Root}Framework\";
|
||||
s_u8APIFramework = $@"{s_u8Root}UFMOM\U8APIFramework\";
|
||||
s_u8workflow = $@"{s_u8Root}Workflow\Lib\";
|
||||
s_u8BusinessNotify = $@"{s_u8Root}BusinessNotify\";
|
||||
|
||||
|
||||
}
|
||||
@@ -94,6 +96,8 @@ namespace UFIDA.U8.Framework.Api
|
||||
return Assembly.LoadFrom(s_u8APIFramework + sAsmName);
|
||||
if (File.Exists(s_u8workflow + sAsmName))
|
||||
return Assembly.LoadFrom(s_u8workflow + sAsmName);
|
||||
if (File.Exists(s_u8BusinessNotify + sAsmName))
|
||||
return Assembly.LoadFrom(s_u8BusinessNotify + sAsmName);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -298,6 +302,7 @@
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -413,14 +418,19 @@
|
||||
<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="Entity\SysTradeResult.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
@@ -436,6 +446,10 @@
|
||||
<Content Include="App_Data\U8API.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="App_Data\MO\补料申请单模板.json" />
|
||||
<Content Include="App_Data\供应商存货调价单模板.json" />
|
||||
<None Include="App_Data\来料报检单模板.json" />
|
||||
<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 +501,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>
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Threading.Tasks;
|
||||
using UFIDA.U8.Framework.Api.Common.Unit.GM;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.Entity;
|
||||
using UFIDA.U8.Framework.Api.Models;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Unit
|
||||
{
|
||||
@@ -108,11 +102,11 @@ namespace UFIDA.U8.Framework.Api.Unit
|
||||
/// <param name="bAP"></param>
|
||||
/// <param name="pDate"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<LoginParamter> GetLoginParamter(string cAccId,bool bAP=false,string pDate="")
|
||||
public static async Task<LoginParamter> GetLoginParamter(string cAccId, bool bAP = false, string pDate = "")
|
||||
{
|
||||
var db = new SqlSugarClient(GetConnectionConfig());
|
||||
|
||||
var account=await db.Queryable<SysU8AccountConfig>().FirstAsync(a => a.Status == StatusEnum.Enable && a.cAccountNo == cAccId);
|
||||
var account = await db.Queryable<SysU8AccountConfig>().FirstAsync(a => a.Status == StatusEnum.Enable && a.cAccountNo == cAccId);
|
||||
|
||||
if (account != null)
|
||||
{
|
||||
@@ -145,6 +139,63 @@ namespace UFIDA.U8.Framework.Api.Unit
|
||||
var token = CommUnit.GetDecrypt(output.userToken);
|
||||
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存请求结果
|
||||
/// </summary>
|
||||
/// <param name="tradeid"></param>
|
||||
/// <param name="bRun"></param>
|
||||
/// <param name="result"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static async Task SaveResult(string tradeid, bool bRun, BaseResult<string> result = null)
|
||||
{
|
||||
var db = GetDbClient();
|
||||
|
||||
if (!db.DbMaintenance.IsAnyTable("SysTradeResult"))
|
||||
{
|
||||
db.CodeFirst.InitTables(typeof(SysTradeResult));
|
||||
}
|
||||
|
||||
if (bRun == true)
|
||||
{
|
||||
if (await db.Queryable<SysTradeResult>().AnyAsync(a => a.cTradeId == tradeid))
|
||||
{
|
||||
throw new Exception($"请求ID:{tradeid}重复");
|
||||
}
|
||||
|
||||
var count = await db.Queryable<SysTradeResult>().CountAsync();
|
||||
|
||||
if (count > 1000)
|
||||
{
|
||||
var idList = await db.Queryable<SysTradeResult>().Select(a => a.Id).Take(count - 1000).ToListAsync();
|
||||
|
||||
await db.Deleteable<SysTradeResult>().Where(a => idList.Contains(a.Id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
var entity = new SysTradeResult
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
bRun = bRun,
|
||||
cTradeId = tradeid,
|
||||
cResult = result,
|
||||
dStartDate = DateTime.Now,
|
||||
};
|
||||
|
||||
await db.Insertable(entity).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await db.Queryable<SysTradeResult>().Where(a => a.cTradeId == tradeid).FirstAsync();
|
||||
|
||||
entity.cResult = result;
|
||||
entity.bRun = false;
|
||||
entity.dEndDate = DateTime.Now;
|
||||
|
||||
await db.Updateable(entity).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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