😎验证wbs状态方法
This commit is contained in:
parent
632bb7ba48
commit
3bf222fa63
@ -9,10 +9,13 @@ using DocumentFormat.OpenXml.Bibliography;
|
||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Server.IISIntegration;
|
||||
using NewLife;
|
||||
using Qiniu.CDN;
|
||||
using RazorEngine;
|
||||
using RazorEngine.Compilation.ImpromptuInterface;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -20,6 +23,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Vistar.Application.Entity;
|
||||
using Vistar.Application.SapService.Dto;
|
||||
using Vistar.Application.Util;
|
||||
using static SKIT.FlurlHttpClient.Wechat.Api.Models.CgibinAccountGetAccountBasicInfoResponse.Types;
|
||||
|
||||
namespace Vistar.Application.Common;
|
||||
@ -395,5 +399,157 @@ public class DataValidationService : IDynamicApiController, ITransient
|
||||
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