Compare commits
No commits in common. "8bb736005a1a712b46e39cc52e2a2c1b6d89c675" and "1f2458c0ea45e6c826a31bc97e11a11f689c16dd" have entirely different histories.
8bb736005a
...
1f2458c0ea
@ -8,10 +8,8 @@ using Admin.NET.Core;
|
|||||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||||
using Furion.DependencyInjection;
|
using Furion.DependencyInjection;
|
||||||
using Furion.DynamicApiController;
|
using Furion.DynamicApiController;
|
||||||
using Microsoft.AspNetCore.Server.IISIntegration;
|
|
||||||
using NewLife;
|
using NewLife;
|
||||||
using RazorEngine;
|
using RazorEngine;
|
||||||
using RazorEngine.Compilation.ImpromptuInterface;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -32,7 +30,6 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
public SqlSugarRepository<Obj122> _obj122Rep;
|
public SqlSugarRepository<Obj122> _obj122Rep;
|
||||||
public SqlSugarRepository<Obj137> _obj137Rep;
|
public SqlSugarRepository<Obj137> _obj137Rep;
|
||||||
public SqlSugarRepository<ObjectTypeCheckList> _objectTypeCheckListRep;
|
public SqlSugarRepository<ObjectTypeCheckList> _objectTypeCheckListRep;
|
||||||
public SqlSugarRepository<ConfigurationData> _configurationDataRep;
|
|
||||||
public DataValidationService(
|
public DataValidationService(
|
||||||
SqlSugarRepository<Obj110> obj110Rep,
|
SqlSugarRepository<Obj110> obj110Rep,
|
||||||
SqlSugarRepository<Obj109> obj109Rep,
|
SqlSugarRepository<Obj109> obj109Rep,
|
||||||
@ -40,9 +37,7 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
SqlSugarRepository<Obj133> obj133Rep,
|
SqlSugarRepository<Obj133> obj133Rep,
|
||||||
SqlSugarRepository<Obj122> obj122Rep,
|
SqlSugarRepository<Obj122> obj122Rep,
|
||||||
SqlSugarRepository<Obj137> obj137Rep,
|
SqlSugarRepository<Obj137> obj137Rep,
|
||||||
SqlSugarRepository<ObjectTypeCheckList> objectTypeCheckList,
|
SqlSugarRepository<ObjectTypeCheckList> objectTypeCheckList
|
||||||
SqlSugarRepository<ConfigurationData> configurationDataRep
|
|
||||||
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_obj110Rep = obj110Rep;
|
_obj110Rep = obj110Rep;
|
||||||
@ -52,7 +47,6 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
_obj122Rep = obj122Rep;
|
_obj122Rep = obj122Rep;
|
||||||
_obj137Rep = obj137Rep;
|
_obj137Rep = obj137Rep;
|
||||||
_objectTypeCheckListRep = objectTypeCheckList;
|
_objectTypeCheckListRep = objectTypeCheckList;
|
||||||
_configurationDataRep = configurationDataRep;
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证物料是否存在
|
/// 验证物料是否存在
|
||||||
@ -185,120 +179,4 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
return unit;
|
return unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取记录ID
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="objId">对象id</param>
|
|
||||||
/// <param name="recordGuid">物料guid</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<long> GetRecordId(long objId, string recordGuid)
|
|
||||||
{
|
|
||||||
long idRecord = 0;
|
|
||||||
if (objId == 137)
|
|
||||||
{
|
|
||||||
var data = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync();
|
|
||||||
idRecord = data.idRecord;
|
|
||||||
}
|
|
||||||
if (objId == 112)
|
|
||||||
{
|
|
||||||
var data = await _obj112Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync();
|
|
||||||
idRecord = data.idRecord;
|
|
||||||
}
|
|
||||||
return idRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 通过id和对象id获取物料编码
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="objId">对象id</param>
|
|
||||||
/// <param name="id">物料guid</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetCoding(long objId, long id)
|
|
||||||
{
|
|
||||||
string coding = "编码不存在";
|
|
||||||
if (objId == 137)
|
|
||||||
{
|
|
||||||
var data = await _obj137Rep.AsQueryable().Where(x => x.idRecord == id).FirstAsync();
|
|
||||||
coding = data._System_objNBS;
|
|
||||||
}
|
|
||||||
if (objId == 112)
|
|
||||||
{
|
|
||||||
var data = await _obj112Rep.AsQueryable().Where(x => x.idRecord == id).FirstAsync();
|
|
||||||
coding = data._System_objNBS;
|
|
||||||
}
|
|
||||||
return coding;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取行号
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="objId">对象id</param>
|
|
||||||
/// <param name="recordGuid">guid</param>
|
|
||||||
/// <param name="versionIndex">版本</param>
|
|
||||||
/// <param name="configId">配置id</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<int> GetLineNumber(long objId, string recordGuid, int versionIndex, int configId)
|
|
||||||
{
|
|
||||||
int lineNumber = 0;
|
|
||||||
|
|
||||||
if (objId==118)
|
|
||||||
{
|
|
||||||
lineNumber = await _configurationDataRep.AsQueryable().Where(x => x.ParentGuid == recordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && x.ConfigId == configId && x.isSuppressed == false && x.inContext == false).CountAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
return lineNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成guid
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetGuid()
|
|
||||||
{
|
|
||||||
await Task.Delay(0);
|
|
||||||
// 生成一个新的Guid实例
|
|
||||||
Guid guid = Guid.NewGuid();
|
|
||||||
|
|
||||||
// 将Guid转换为字符串形式
|
|
||||||
string uuidString = guid.ToString();
|
|
||||||
|
|
||||||
return uuidString;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 对比物料版本
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="objId"></param>
|
|
||||||
/// <param name="recordGuid"></param>
|
|
||||||
/// <param name="newVersion"></param>
|
|
||||||
/// <param name="olderVersion"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> ComparativeVersion(long objId, string recordGuid, int newVersion, int olderVersion)
|
|
||||||
{
|
|
||||||
string contrastResult ="";
|
|
||||||
|
|
||||||
if (objId == 137)
|
|
||||||
{
|
|
||||||
var contrastNewData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false && x.VersionIndex == newVersion).FirstAsync();
|
|
||||||
var contrastOlderData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false && x.VersionIndex == olderVersion).FirstAsync();
|
|
||||||
if (contrastNewData.revision == contrastOlderData.revision)
|
|
||||||
{
|
|
||||||
contrastResult = "是";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (objId == 112)
|
|
||||||
{
|
|
||||||
var contrastNewData = await _obj112Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false && x.VersionIndex == newVersion).FirstAsync();
|
|
||||||
var contrastOlderData = await _obj112Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false && x.VersionIndex == olderVersion).FirstAsync();
|
|
||||||
if (contrastNewData.revision == contrastOlderData.revision)
|
|
||||||
{
|
|
||||||
contrastResult = "是";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return contrastResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -660,7 +660,7 @@ public class SapService : IDynamicApiController, ITransient
|
|||||||
content.Headers.ContentType = new MediaTypeHeaderValue("text/xml");
|
content.Headers.ContentType = new MediaTypeHeaderValue("text/xml");
|
||||||
httpClient.DefaultRequestHeaders.Add("Accept-Language", "zh");
|
httpClient.DefaultRequestHeaders.Add("Accept-Language", "zh");
|
||||||
// 设置 SAP Web 服务的 URL
|
// 设置 SAP Web 服务的 URL
|
||||||
var url = "https://vhjqeps4ci.sap.vistar-eq.com:44300/sap/bc/srt/rfc/sap/zmmfm013/100/zmmfm013/zmmfm013";
|
var url = "https://vhjqeds4ci.sap.vistar-eq.com:44300/sap/bc/srt/rfc/sap/zmmfm013/120/zmmfm013/zmmfm013";
|
||||||
|
|
||||||
// 发起 POST 请求到 SAP Web 服务
|
// 发起 POST 请求到 SAP Web 服务
|
||||||
var response = await httpClient.PostAsync(url, content);
|
var response = await httpClient.PostAsync(url, content);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user