😭更新产品管理库实体类、输入输出类,修改产品管理库接口查询条件
This commit is contained in:
parent
d17362eb97
commit
7871fd905c
@ -547,12 +547,6 @@ public class Obj137
|
||||
[SugarColumn(ColumnName = "_SWPDM_94_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_94_PDF___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_101_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_101_PDF___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@ -565,17 +559,8 @@ public class Obj137
|
||||
[SugarColumn(ColumnName = "_SWPDM_96_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_96_PDF___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_97_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_97_PDF___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_98_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_98_PDF___ { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@ -589,11 +574,7 @@ public class Obj137
|
||||
[SugarColumn(ColumnName = "_SWPDM_99_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_99_PDF___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_100_PDF___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_100_PDF___ { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@ -757,17 +738,7 @@ public class Obj137
|
||||
[SugarColumn(ColumnName = "_SWPDM_60_SW___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_60_SW___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_124_SW___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_124_SW___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_102_SW___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_102_SW___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@ -919,12 +890,6 @@ public class Obj137
|
||||
[SugarColumn(ColumnName = "_SWPDM_1202_SW_____", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_1202_SW_____ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "_SWPDM_49_SW___", ColumnDescription = "", Length = -1)]
|
||||
public string? _SWPDM_49_SW___ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
@ -191,21 +191,17 @@ public class ProductDesignLibraryOutput
|
||||
public string? _SWPDM_91_FB_____ { get; set; }
|
||||
public string? _SWPDM_94_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_101_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_95_PDF_____ { get; set; }
|
||||
|
||||
public string? _SWPDM_96_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_97_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_98_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_93_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_99_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_100_PDF___ { get; set; }
|
||||
|
||||
public string? _SWPDM_1194_q { get; set; }
|
||||
|
||||
@ -260,10 +256,6 @@ public class ProductDesignLibraryOutput
|
||||
|
||||
public string? _SWPDM_60_SW___ { get; set; }
|
||||
|
||||
public string? _SWPDM_124_SW___ { get; set; }
|
||||
|
||||
public string? _SWPDM_102_SW___ { get; set; }
|
||||
|
||||
public string? _SWPDM_56_SW____ { get; set; }
|
||||
|
||||
public string? _SWPDM_57_SW______ { get; set; }
|
||||
@ -314,7 +306,6 @@ public class ProductDesignLibraryOutput
|
||||
|
||||
public string? _SWPDM_1202_SW_____ { get; set; }
|
||||
|
||||
public string? _SWPDM_49_SW___ { get; set; }
|
||||
|
||||
public string? _SWPDM_129_SW_____ { get; set; }
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
public async Task<SqlSugarPagedList<ProductDesignLibraryOutput>> Page(PageProductDesignLibraryInput input)
|
||||
{
|
||||
var query = await _obj137Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
|
||||
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW"))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input._System_objNBS), u => u._System_objNBS.Contains(input._System_objNBS.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input._SWPDM_1188_SAP___), u => u._SWPDM_1188_SAP___.Contains(input._SWPDM_1188_SAP___.Trim()))
|
||||
.Select<ProductDesignLibraryOutput>()
|
||||
@ -189,10 +189,10 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
{
|
||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
|
||||
var parent = await _obj137Rep.AsQueryable()
|
||||
.Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
|
||||
.Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW"))
|
||||
.MaxAsync(x => x.VersionIndex);
|
||||
var BomData = await _configurationDataRep.AsQueryable()
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含" || x.fld005577 == null))
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含" || x.fld005577 == null)&&x.isSuppressed==false)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim()))
|
||||
.Select<ProductDesignLibraryBomOutput>().ToPagedListAsync(input.Page, input.PageSize);
|
||||
@ -207,7 +207,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
[DisplayName("产品设计库-Bom同步到SAP")]
|
||||
public async Task<SapOutput> SyncToSAPBom(List<BomPageProductDesignLibraryInput> input)
|
||||
{
|
||||
var ParentData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)).FirstAsync();
|
||||
var ParentData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")).FirstAsync();
|
||||
var EcnData = await _obj118Rep.AsQueryable().Where(x => x.RecordGuid == ParentData.fld005679_Rec && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync();
|
||||
var ecn = "";
|
||||
if (EcnData != null)
|
||||
@ -244,7 +244,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
if (!string.IsNullOrEmpty(ParentData.fld005686))
|
||||
{
|
||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
|
||||
var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null)).ToListAsync();
|
||||
var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync();
|
||||
for (int i = 0; i < BomData.Count; i++)
|
||||
{
|
||||
|
||||
@ -451,37 +451,41 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
public async Task<List<SapOutput>> TimingSyncToSAP()
|
||||
{
|
||||
var input = await _obj137Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x.fld005530 == "A" || x.fld005530 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
|
||||
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x.fld005530 == "A" || x.fld005530 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW"))
|
||||
.ToListAsync();
|
||||
const string lengthError = "物料描述长度大于40,请检查!";
|
||||
var SapOutputList = new List<SapOutput>();
|
||||
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
|
||||
for (int i = 0; i < input.Count; i++)
|
||||
{
|
||||
// 验证物料描述长度
|
||||
if (input[i]._SWPDM_1188_SAP___.Length > 40)
|
||||
if (!string.IsNullOrEmpty(input[i]._SWPDM_1188_SAP___))
|
||||
{
|
||||
await _obj137Rep.AsUpdateable()
|
||||
.SetColumns(it => new Obj137
|
||||
{
|
||||
fld005532 = DateTime.Now,
|
||||
fld005530 = "N",
|
||||
fld005531 = lengthError,
|
||||
fld005529 = "失败"
|
||||
})
|
||||
.Where(it => it.idRecord == input[i].idRecord)
|
||||
.ExecuteCommandAsync().ConfigureAwait(false);
|
||||
|
||||
SapOutputList.Add(new SapOutput()
|
||||
// 验证物料描述长度
|
||||
if (input[i]._SWPDM_1188_SAP___.Length > 40)
|
||||
{
|
||||
materialCode = input[i]._System_objNBS,
|
||||
code = "失败",
|
||||
msg = lengthError,
|
||||
result = lengthError
|
||||
});
|
||||
continue;
|
||||
await _obj137Rep.AsUpdateable()
|
||||
.SetColumns(it => new Obj137
|
||||
{
|
||||
fld005532 = DateTime.Now,
|
||||
fld005530 = "N",
|
||||
fld005531 = lengthError,
|
||||
fld005529 = "失败"
|
||||
})
|
||||
.Where(it => it.idRecord == input[i].idRecord)
|
||||
.ExecuteCommandAsync().ConfigureAwait(false);
|
||||
|
||||
SapOutputList.Add(new SapOutput()
|
||||
{
|
||||
materialCode = input[i]._System_objNBS,
|
||||
code = "失败",
|
||||
msg = lengthError,
|
||||
result = lengthError
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取时间戳精确到毫秒,sap要求每次调用生成不重复guid
|
||||
string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
|
||||
var sapMaterialInput = new SapMaterialInput()
|
||||
@ -564,7 +568,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
|
||||
|
||||
var materialData = await _obj137Rep.AsQueryable()
|
||||
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
|
||||
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW"))
|
||||
.ToListAsync();
|
||||
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
||||
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
|
||||
@ -578,7 +582,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
var ecnGuid = item.fld005679_Rec;
|
||||
// 查询 BOM
|
||||
var bomData = await _configurationDataRep.AsQueryable()
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null)).ToListAsync();
|
||||
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync();
|
||||
if (bomData.Count == 0)
|
||||
{
|
||||
continue;
|
||||
@ -618,7 +622,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
if (!string.IsNullOrEmpty(ParentData.fld005686))
|
||||
{
|
||||
var configidold = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
|
||||
var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configidold.ConfigID && x.ParentGuid == bomData[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null)).ToListAsync();
|
||||
var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configidold.ConfigID && x.ParentGuid == bomData[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync();
|
||||
for (int i = 0; i < BomData.Count; i++)
|
||||
{
|
||||
|
||||
@ -724,7 +728,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
&& x.CheckedStatus == 0
|
||||
&& x.deleted == false
|
||||
&& x._system_objConfigurationName == "默认"
|
||||
&& (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)
|
||||
&& !x.SWPDMFileName.Contains("SLDDRW")
|
||||
&& (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null)
|
||||
&& x.fld005530 == "N"
|
||||
&& x.fld005529 == "成功"
|
||||
@ -754,7 +758,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
&& x.deleted == false
|
||||
&& x.VersionIndex == input[0].ParentVersion
|
||||
&& x._system_objConfigurationName == "默认"
|
||||
&& (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)
|
||||
&& !x.SWPDMFileName.Contains("SLDDRW")
|
||||
&& x.CheckedStatus == 0
|
||||
&& (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null)
|
||||
&& x.fld005530 == "N"
|
||||
@ -868,7 +872,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
|
||||
&& x.deleted == false
|
||||
&& x.IsLatestVersion == true
|
||||
&& x._system_objConfigurationName == "默认"
|
||||
&& (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)
|
||||
&& !x.SWPDMFileName.Contains("SLDDRW")
|
||||
&& (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null)
|
||||
&& x.fld005530 == "N"
|
||||
&& x.fld005529 == "成功"
|
||||
|
Loading…
Reference in New Issue
Block a user