新增自定义接口,获取销售订单收款金额
This commit is contained in:
33
Services/OrgService.cs
Normal file
33
Services/OrgService.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GZ_LTHPilot_ORDER.Services
|
||||
{
|
||||
public class OrgService
|
||||
{
|
||||
public Context ctx;
|
||||
public OrgService(Context ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
public DynamicObjectCollection GetOrgList()
|
||||
{
|
||||
var sql = @"/*dialect*/SELECT
|
||||
t0.FORGID,
|
||||
t0l.FNAME,
|
||||
*
|
||||
FROM
|
||||
T_ORG_ORGANIZATIONS t0
|
||||
LEFT JOIN T_ORG_ORGANIZATIONS_L t0L ON t0.FORGID = t0L.FORGID
|
||||
AND FLOCALEID = 2052
|
||||
";
|
||||
return DBServiceHelper.ExecuteDynamicObject(this.ctx, sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,11 +86,15 @@ WHERE
|
||||
var result = JsonConvert.DeserializeObject<KingdeeResult<SaleExecuteOut>>(resultString);
|
||||
var rows = result.Result.Rows;
|
||||
var dataRow = rows.Where(n => n.FBILLNO == billNo).FirstOrDefault();
|
||||
if (dataRow != null)
|
||||
if (dataRow == null)
|
||||
{
|
||||
return Convert.ToDecimal(dataRow.FALLMATCHAMOUNT);
|
||||
return 0m;
|
||||
}
|
||||
return 0m;
|
||||
if (dataRow.FALLMATCHAMOUNT.IsNullOrEmptyOrWhiteSpace())
|
||||
{
|
||||
return 0m;
|
||||
}
|
||||
return Convert.ToDecimal(dataRow.FALLMATCHAMOUNT);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +129,7 @@ WHERE
|
||||
{
|
||||
FSaleOrgList = orgId,
|
||||
FSoFromDate = startDate,
|
||||
FSoToDate = startDate,
|
||||
FSoToDate = endDate,
|
||||
FFormCloseStatus = "ALL",
|
||||
FFormStatus = "C",
|
||||
FPriceFrom = "SALORDERBILL",
|
||||
|
||||
@@ -59,6 +59,7 @@ FROM
|
||||
AND FCANCELSTATUS = 'A'
|
||||
AND FSALEORGID = '{0}'
|
||||
AND F_PaperNumber = '{1}'
|
||||
AND FDATE >= '2025-01-01'
|
||||
UNION ALL
|
||||
SELECT
|
||||
'100302' FSALEORGID, -- 销售组织
|
||||
|
||||
47
Services/TempTableService.cs
Normal file
47
Services/TempTableService.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GZ_LTHPilot_ORDER.Services
|
||||
{
|
||||
internal class TempTableService
|
||||
{
|
||||
|
||||
private Context ctx;
|
||||
|
||||
public TempTableService(Context ctx)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除临时表
|
||||
/// </summary>
|
||||
/// <param name="ctx"></param>
|
||||
/// <param name="tempTable"></param>
|
||||
public void DropTempTable(string tableName)
|
||||
{
|
||||
if (!tableName.IsNullOrEmptyOrWhiteSpace())
|
||||
{
|
||||
IDBService dbservice = ServiceHelper.GetService<IDBService>();
|
||||
dbservice.DeleteTemporaryTableName(ctx, new string[] { tableName });
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建临时表
|
||||
/// </summary>
|
||||
/// <param name="ctx"></param>
|
||||
/// <returns></returns>
|
||||
public string CreateTempTable()
|
||||
{
|
||||
IDBService dbservice = ServiceHelper.GetService<IDBService>();
|
||||
string[] temptables = dbservice.CreateTemporaryTableName(ctx, 1);
|
||||
return temptables[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user