😭修改接口逻辑

This commit is contained in:
bairubing 2024-11-22 14:52:59 +08:00
parent a311452ab2
commit 1f2458c0ea
4 changed files with 309 additions and 45 deletions

View File

@ -598,4 +598,13 @@ public class ConfigurationData
/// 基本数量
/// </summary>
public string fld005575 { get; set; }
public string fld006140 { get; set; }
public string fld006141 { get; set; }
public string fld006142 { get; set; }
public string fld006143 { get; set; }
public DateTime fld006144 { get; set; }
public string fld006145 { get; set; }
public string fld006146 { get; set; }
public string fld006147 { get; set; }
}

View File

@ -0,0 +1,187 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Vistar.Application.SapService.Dto;
public class SapPurchasingRequisitionInput
{
/// <summary>
/// 接口唯一ID
/// </summary>
public string Reqkeyid { get; set; }
/// <summary>
/// 业务唯一ID
/// </summary>
public string Businessid { get; set; }
/// <summary>
/// 传入消息ID
/// </summary>
public string Messageid { get; set; }
/// <summary>
/// 发送方的合作伙伴编号
/// </summary>
public string Sndprn { get; set; }
/// <summary>
/// 接收方的合作伙伴编号
/// </summary>
public string Rcvprn { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string Requser { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note1 { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note2 { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note3 { get; set; }
/// <summary>
/// 外部唯一ID
/// </summary>
public string Zwbid { get; set; }
/// <summary>
/// 采购申请编号
/// </summary>
public string Banfn { get; set; }
/// <summary>
/// 采购申请凭证类型
/// </summary>
public string Bsart { get; set; }
/// <summary>
/// 业务修改类型I/U
/// </summary>
public string Zoperate { get; set; }
/// <summary>
/// 抬头备用1
/// </summary>
public string Zttby1 { get; set; }
/// <summary>
/// 抬头备用2
/// </summary>
public string Zttby2 { get; set; }
/// <summary>
/// 抬头备用3
/// </summary>
public string Zttby3 { get; set; }
public List<SapPurchasingRequisitionItem> Item { get; set; }
}
public class SapPurchasingRequisitionItem
{
/// <summary>
/// 采购申请的项目编号
/// </summary>
public string Bnfpo { get; set; }
/// <summary>
/// 紧急标识
/// </summary>
public string Zzjjbs { get; set; }
/// <summary>
/// 科目分配类别
/// </summary>
public string Knttp { get; set; }
/// <summary>
/// 采购凭证中的项目类别
/// </summary>
public string Pstyp { get; set; }
/// <summary>
/// 物料编号
/// </summary>
public string Matnr { get; set; }
/// <summary>
/// 短文本
/// </summary>
public string Txz01 { get; set; }
/// <summary>
/// 数量
/// </summary>
public string Menge { get; set; }
/// <summary>
/// 基本计量单位
/// </summary>
public string Meins { get; set; }
/// <summary>
/// 项目交货日期
/// </summary>
public string Lfdat { get; set; }
/// <summary>
/// 物料组
/// </summary>
public string Matkl { get; set; }
/// <summary>
/// 工厂
/// </summary>
public string Werks { get; set; }
/// <summary>
/// 存储地点
/// </summary>
public string Lgort { get; set; }
/// <summary>
/// 采购组
/// </summary>
public string Ekgrp { get; set; }
/// <summary>
/// 采购组织
/// </summary>
public string Ekorg { get; set; }
/// <summary>
/// 项目号
/// </summary>
public string Zzpspnr { get; set; }
/// <summary>
/// 申请人姓名
/// </summary>
public string Afnam { get; set; }
/// <summary>
/// 采购凭证中的删除标识
/// </summary>
public string Loekz { get; set; }
}

View File

@ -293,6 +293,8 @@ public class ProductManagementService : IDynamicApiController, ITransient
};
var apiOutput = await _sapService.SapBomApi(isreq);
string codeVal = apiOutput.code == "S" ? "成功" : "失败";
if (codeVal == "成功")
{
await _obj110Rep.AsUpdateable()
.SetColumns(it => new Obj110
{
@ -304,6 +306,21 @@ public class ProductManagementService : IDynamicApiController, ITransient
})
.Where(it => it.idRecord == ParentData.idRecord)
.ExecuteCommandAsync();
}
else
{
await _obj110Rep.AsUpdateable()
.SetColumns(it => new Obj110
{
fld004631 = DateTime.Now,
fld004315 = codeVal,
fld004316 = "N",
fld004317 = apiOutput.msg
})
.Where(it => it.idRecord == ParentData.idRecord)
.ExecuteCommandAsync();
}
var msg = apiOutput.msg;
if (apiOutput.msg == "")
{
@ -674,6 +691,23 @@ public class ProductManagementService : IDynamicApiController, ITransient
var apiOutput = await _sapService.SapBomApi(isreq);
string codeVal = apiOutput.code == "S" ? "成功" : "失败";
if (codeVal == "成功")
{
await _obj110Rep.AsUpdateable()
.SetColumns(it => new Obj110
{
fld004631 = DateTime.Now,
fld004315 = codeVal,
fld004316 = "N",
fld004317 = apiOutput.msg,
fld005288 = versionIndex.ToString()
})
.Where(it => it.idRecord == item.idRecord)
.ExecuteCommandAsync();
}
else
{
await _obj110Rep.AsUpdateable()
.SetColumns(it => new Obj110
{
@ -684,6 +718,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
})
.Where(it => it.idRecord == item.idRecord)
.ExecuteCommandAsync();
}
var msg = apiOutput.msg;
if (string.IsNullOrEmpty(msg))

View File

@ -300,6 +300,8 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
};
var apiOutput = await _sapService.SapBomApi(isreq);
string codeVal = apiOutput.code == "S" ? "成功" : "失败";
if (codeVal == "成功")
{
await _obj137Rep.AsUpdateable()
.SetColumns(it => new Obj137
{
@ -311,6 +313,20 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
})
.Where(it => it.idRecord == ParentData.idRecord)
.ExecuteCommandAsync();
}
else {
await _obj137Rep.AsUpdateable()
.SetColumns(it => new Obj137
{
fld005539 = DateTime.Now,
fld005533 = codeVal,
fld005534 = "N",
fld005535 = apiOutput.msg
})
.Where(it => it.idRecord == ParentData.idRecord)
.ExecuteCommandAsync();
}
var msg = apiOutput.msg;
if (apiOutput.msg == "")
{
@ -681,6 +697,9 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
var apiOutput = await _sapService.SapBomApi(isreq);
string codeVal = apiOutput.code == "S" ? "成功" : "失败";
if (codeVal == "成功")
{
await _obj137Rep.AsUpdateable()
.SetColumns(it => new Obj137
{
@ -688,10 +707,24 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
fld005533 = codeVal,
fld005534 = "N",
fld005535 = apiOutput.msg,
fld005686 = bomData[0].ParentVersion.ToString()
fld005686 = versionIndex.ToString()
})
.Where(it => it.idRecord == item.idRecord)
.ExecuteCommandAsync();
}
else
{
await _obj137Rep.AsUpdateable()
.SetColumns(it => new Obj137
{
fld005539 = DateTime.Now,
fld005533 = codeVal,
fld005534 = "N",
fld005535 = apiOutput.msg
})
.Where(it => it.idRecord == item.idRecord)
.ExecuteCommandAsync();
}
var msg = apiOutput.msg;
if (string.IsNullOrEmpty(msg))