😎验证wbs状态方法
This commit is contained in:
parent
632bb7ba48
commit
3bf222fa63
@ -9,10 +9,13 @@ using DocumentFormat.OpenXml.Bibliography;
|
|||||||
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.Authorization;
|
||||||
using Microsoft.AspNetCore.Server.IISIntegration;
|
using Microsoft.AspNetCore.Server.IISIntegration;
|
||||||
using NewLife;
|
using NewLife;
|
||||||
|
using Qiniu.CDN;
|
||||||
using RazorEngine;
|
using RazorEngine;
|
||||||
using RazorEngine.Compilation.ImpromptuInterface;
|
using RazorEngine.Compilation.ImpromptuInterface;
|
||||||
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -20,6 +23,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Vistar.Application.Entity;
|
using Vistar.Application.Entity;
|
||||||
using Vistar.Application.SapService.Dto;
|
using Vistar.Application.SapService.Dto;
|
||||||
|
using Vistar.Application.Util;
|
||||||
using static SKIT.FlurlHttpClient.Wechat.Api.Models.CgibinAccountGetAccountBasicInfoResponse.Types;
|
using static SKIT.FlurlHttpClient.Wechat.Api.Models.CgibinAccountGetAccountBasicInfoResponse.Types;
|
||||||
|
|
||||||
namespace Vistar.Application.Common;
|
namespace Vistar.Application.Common;
|
||||||
@ -243,11 +247,11 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
int lineNumber = 0;
|
int lineNumber = 0;
|
||||||
|
|
||||||
if (objId==118)
|
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();
|
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;
|
return lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +263,7 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
await Task.Delay(0);
|
await Task.Delay(0);
|
||||||
// 生成一个新的Guid实例
|
// 生成一个新的Guid实例
|
||||||
Guid guid = Guid.NewGuid();
|
Guid guid = Guid.NewGuid();
|
||||||
|
|
||||||
// 将Guid转换为字符串形式
|
// 将Guid转换为字符串形式
|
||||||
string uuidString = guid.ToString();
|
string uuidString = guid.ToString();
|
||||||
@ -277,7 +281,7 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> ComparativeVersion(long objId, string recordGuid, int newVersion, int olderVersion)
|
public async Task<string> ComparativeVersion(long objId, string recordGuid, int newVersion, int olderVersion)
|
||||||
{
|
{
|
||||||
string contrastResult ="";
|
string contrastResult = "";
|
||||||
|
|
||||||
if (objId == 137)
|
if (objId == 137)
|
||||||
{
|
{
|
||||||
@ -313,13 +317,13 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
/// <param name="ZwqslPr"></param>
|
/// <param name="ZwqslPr"></param>
|
||||||
/// <param name="dateUpdated"></param>
|
/// <param name="dateUpdated"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> ModifyInventoryInformation(string recordGuid,string code,long objectid,string Bdmng, string Labst, string ZwqslPo, string ZwqslPr, DateTime dateUpdated)
|
public async Task<string> ModifyInventoryInformation(string recordGuid, string code, long objectid, string Bdmng, string Labst, string ZwqslPo, string ZwqslPr, DateTime dateUpdated)
|
||||||
{
|
{
|
||||||
if (code=="S")
|
if (code == "S")
|
||||||
{
|
{
|
||||||
if (objectid == 137)
|
if (objectid == 137)
|
||||||
{
|
{
|
||||||
var data = _obj137Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false).OrderByDescending(x => x.idRecord).First();
|
var data = _obj137Rep.AsQueryable().Where(x => x.RecordGuid == recordGuid && x.deleted == false).OrderByDescending(x => x.idRecord).First();
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
await _obj137Rep.AsUpdateable().SetColumns(it => new Obj137
|
await _obj137Rep.AsUpdateable().SetColumns(it => new Obj137
|
||||||
@ -395,5 +399,157 @@ public class DataValidationService : IDynamicApiController, ITransient
|
|||||||
return "修改成功";
|
return "修改成功";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<string> cscscs1()
|
||||||
|
{
|
||||||
|
await Task.Delay(20000);
|
||||||
|
return "测试1执行时间" + DateTime.Now.ToString("HH:dd:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<string> cscscs2()
|
||||||
|
{
|
||||||
|
await Task.Delay(20000);
|
||||||
|
return "测试2执行时间" + DateTime.Now.ToString("HH:dd:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SAP wbs状态
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<string> ProjProcStatus(string status)
|
||||||
|
{
|
||||||
|
await Task.Delay(0);
|
||||||
|
if (status == "进行中")
|
||||||
|
{
|
||||||
|
return "REL";
|
||||||
|
}
|
||||||
|
if (status == "未启动")
|
||||||
|
{
|
||||||
|
return "CRTD";
|
||||||
|
}
|
||||||
|
if (status == "暂停")
|
||||||
|
{
|
||||||
|
return "TECO";
|
||||||
|
}
|
||||||
|
if (status == "已完成")
|
||||||
|
{
|
||||||
|
return "TEL";
|
||||||
|
}
|
||||||
|
if (status == "已取消")
|
||||||
|
{
|
||||||
|
return "TECO";
|
||||||
|
}
|
||||||
|
if (status == "删除")
|
||||||
|
{
|
||||||
|
return "DLFL";
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 验证是否存在bom和工艺路线
|
||||||
|
///// </summary>
|
||||||
|
///// <returns></returns>
|
||||||
|
//public async Task<List<IsBomAndProcessRouteExistOutput>> IsBomAndProcessRouteExist()
|
||||||
|
//{
|
||||||
|
// //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.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW"))
|
||||||
|
// // .ToListAsync();
|
||||||
|
|
||||||
|
// //查询需要同步的产品
|
||||||
|
// var materialData = await _obj137Rep.AsQueryable()
|
||||||
|
// .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW") && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && (x.fld005537 == "A" || x.fld005537 == "M"))
|
||||||
|
// .ToListAsync();
|
||||||
|
|
||||||
|
// //分组查询最大版本的物料
|
||||||
|
// var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
||||||
|
// .Select(group => group.OrderByDescending(item => item.VersionIndex).First())
|
||||||
|
// .ToList();
|
||||||
|
|
||||||
|
// var output = new List<string>();
|
||||||
|
// var outputList = new List<IsBomAndProcessRouteExistOutput>();
|
||||||
|
|
||||||
|
// var tasks = groupedData.Select(async item =>
|
||||||
|
// {
|
||||||
|
// var versionIndex = item.VersionIndex;
|
||||||
|
// var processRouteData = await _configurationDataRep.CopyNew().AsQueryable()
|
||||||
|
// .Where(x => x.ConfigId == 8 && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex).ToListAsync();
|
||||||
|
// if (processRouteData.Count == 0)
|
||||||
|
// {
|
||||||
|
// await _obj137Rep.CopyNew().AsUpdateable()
|
||||||
|
// .SetColumns(it => new Obj137
|
||||||
|
// {
|
||||||
|
// fld005534 = "N",
|
||||||
|
// })
|
||||||
|
// .Where(it => it.idRecord == item.idRecord)
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
// var oub = new IsBomAndProcessRouteExistOutput
|
||||||
|
// {
|
||||||
|
// objId = 137,
|
||||||
|
// materialCode = item._System_objNBS,
|
||||||
|
// isSuccess = "刷新成功"
|
||||||
|
|
||||||
|
// };
|
||||||
|
|
||||||
|
// outputList.Add(oub);
|
||||||
|
// return new IsBomAndProcessRouteExistOutput
|
||||||
|
// {
|
||||||
|
// objId = 137,
|
||||||
|
// materialCode = item._System_objNBS,
|
||||||
|
// isSuccess = "刷新成功"
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
// return new IsBomAndProcessRouteExistOutput
|
||||||
|
// {
|
||||||
|
// objId = 137,
|
||||||
|
// materialCode = item._System_objNBS,
|
||||||
|
// isSuccess = "刷新失败"
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
// var bomStockInquiryOutput = await Task.WhenAll(tasks);
|
||||||
|
|
||||||
|
// //foreach (var item in groupedData)
|
||||||
|
// //{
|
||||||
|
// // // 获取版本号
|
||||||
|
// // var versionIndex = item.VersionIndex;
|
||||||
|
// // //var bomData = await _configurationDataRep.AsQueryable()
|
||||||
|
// // // .Where(x => x.ConfigId == 8 && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false && x.inContext == false).ToListAsync();
|
||||||
|
|
||||||
|
// // //if (bomData.Count == 0)
|
||||||
|
// // //{
|
||||||
|
// // // await _obj137Rep.AsUpdateable()
|
||||||
|
// // // .SetColumns(it => new Obj137
|
||||||
|
// // // {
|
||||||
|
// // // fld005534 = "N",
|
||||||
|
// // // })
|
||||||
|
// // // .Where(it => it.idRecord == item.idRecord)
|
||||||
|
// // // .ExecuteCommandAsync();
|
||||||
|
// // // continue;
|
||||||
|
// // //}
|
||||||
|
|
||||||
|
|
||||||
|
// // var processRouteData = await _configurationDataRep.AsQueryable()
|
||||||
|
// // .Where(x => x.ConfigId == 9 && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex).ToListAsync();
|
||||||
|
// // if (processRouteData.Count == 0)
|
||||||
|
// // {
|
||||||
|
// // await _obj137Rep.AsUpdateable()
|
||||||
|
// // .SetColumns(it => new Obj137
|
||||||
|
// // {
|
||||||
|
// // fld005537 = "N",
|
||||||
|
// // })
|
||||||
|
// // .Where(it => it.idRecord == item.idRecord)
|
||||||
|
// // .ExecuteCommandAsync();
|
||||||
|
// // continue;
|
||||||
|
// // }
|
||||||
|
// //}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// return outputList;
|
||||||
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user