Updated azure-pipelines-server.yml
Changed to thunderclient to messa017 Nuget Bump Scan Helper
This commit is contained in:
53
Server/ApiControllers/ReactorsController.cs
Normal file
53
Server/ApiControllers/ReactorsController.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace OI.Metrology.Server.ApiControllers;
|
||||
|
||||
[Route("api/[controller]")]
|
||||
public class ReactorsController : Controller, IReactorsController<IActionResult>
|
||||
{
|
||||
|
||||
private readonly IReactorsRepository _ReactorsRepository;
|
||||
|
||||
public ReactorsController(IReactorsRepository reactorsRepository) =>
|
||||
_ReactorsRepository = reactorsRepository;
|
||||
|
||||
[HttpGet("{even}")]
|
||||
public IActionResult Get(bool even) =>
|
||||
Json(even ? _ReactorsRepository.EvenReactors() : _ReactorsRepository.OddReactors(), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
[HttpPost()]
|
||||
public IActionResult Post(Shared.DataModels.WorkMaterialOut workMaterialOut)
|
||||
{
|
||||
string? result = null;
|
||||
if (workMaterialOut is null)
|
||||
throw new Exception();
|
||||
if (workMaterialOut.Username is null || workMaterialOut.Username.Length < 2)
|
||||
throw new ArgumentException(nameof(workMaterialOut.Username));
|
||||
if (workMaterialOut.RunDataSheet is null || workMaterialOut.RunDataSheet.Length < 2)
|
||||
throw new ArgumentException(nameof(workMaterialOut.RunDataSheet));
|
||||
string? fileName = null;
|
||||
DateTime dateTime = DateTime.Now;
|
||||
Calendar calendar = new CultureInfo("en-US").Calendar;
|
||||
string json = JsonSerializer.Serialize(workMaterialOut, new JsonSerializerOptions { WriteIndented = true });
|
||||
string weekOfYear = $"{dateTime:yyyy}_Week_{calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}";
|
||||
string directory = Path.Combine("D:/Tmp/Metrology", weekOfYear, dateTime.ToString("yyyy-MM-dd"));
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
for (int i = 1; i < int.MaxValue; i++)
|
||||
{
|
||||
result = $"{workMaterialOut.Username.ToUpper()[0]}{dateTime:mmss}";
|
||||
fileName = Path.Combine(directory, $"WMO-{result}.json");
|
||||
if (!System.IO.File.Exists(fileName))
|
||||
break;
|
||||
dateTime = dateTime.AddSeconds(i);
|
||||
}
|
||||
if (fileName is null)
|
||||
throw new Exception();
|
||||
System.IO.File.WriteAllText(fileName, json);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
}
|
20
Server/ApiControllers/WorkMaterialController.cs
Normal file
20
Server/ApiControllers/WorkMaterialController.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace OI.Metrology.Server.ApiControllers;
|
||||
|
||||
[Route("api/[controller]")]
|
||||
public class WorkMaterialController : Controller, IWorkMaterialController<IActionResult>
|
||||
{
|
||||
|
||||
private readonly IWorkMaterialRepository _WorkMaterialRepository;
|
||||
|
||||
public WorkMaterialController(IWorkMaterialRepository WorkMaterialRepository) =>
|
||||
_WorkMaterialRepository = WorkMaterialRepository;
|
||||
|
||||
[HttpGet("{mid}")]
|
||||
public IActionResult GetCassette(string mid) =>
|
||||
Json(_WorkMaterialRepository.GetCassette(mid), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
}
|
82
Server/Controllers/ReactorsController.cs
Normal file
82
Server/Controllers/ReactorsController.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using OI.Metrology.Server.Models;
|
||||
using OI.Metrology.Shared.ViewModels;
|
||||
|
||||
namespace OI.Metrology.Server.Controllers;
|
||||
|
||||
public class ReactorsController : Controller
|
||||
{
|
||||
|
||||
private readonly bool _IsTestDatabase;
|
||||
private readonly AppSettings _AppSettings;
|
||||
|
||||
public ReactorsController(AppSettings appSettings)
|
||||
{
|
||||
_AppSettings = appSettings;
|
||||
_IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public override void OnActionExecuted(ActionExecutedContext context)
|
||||
{
|
||||
base.OnActionExecuted(context);
|
||||
ViewBag.IsTestDatabase = _IsTestDatabase;
|
||||
}
|
||||
|
||||
private string GetApiUrl() => string.IsNullOrEmpty(_AppSettings.ApiUrl) ? Url.Content("~/") : _AppSettings.ApiUrl[0] == '~' ? Url.Content(_AppSettings.ApiUrl) : _AppSettings.ApiUrl;
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step1")]
|
||||
[Route("/Metrology/Step1")]
|
||||
public IActionResult Step1(string mod = "", string equipment = "", string layer = "", string zone = "", string rds = "", string initials = "")
|
||||
{
|
||||
string directory = "D:/Tmp/Metrology";
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
string[] model = new string[] { mod, equipment, layer, zone, rds, initials };
|
||||
if (!string.IsNullOrEmpty(initials))
|
||||
System.IO.File.WriteAllLines(Path.Combine(directory, $"{DateTime.Now.Ticks}-{initials}.rsv"), model);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step2")]
|
||||
[Route("/Metrology/Step2")]
|
||||
public IActionResult Step2(string mod) =>
|
||||
View(new string[] { mod });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step3")]
|
||||
[Route("/Metrology/Step3")]
|
||||
public IActionResult Step3(string mod, string equipment) =>
|
||||
View(new string[] { mod, equipment });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step4")]
|
||||
[Route("/Metrology/Step4")]
|
||||
public IActionResult Step4(string mod, string equipment, string layer) =>
|
||||
View(new string[] { mod, equipment, layer });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step5")]
|
||||
[Route("/Metrology/Step5")]
|
||||
public IActionResult Step5(string mod, string equipment, string layer, string zone) =>
|
||||
View(new string[] { mod, equipment, layer, zone });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step6")]
|
||||
[Route("/Metrology/Step6")]
|
||||
public IActionResult Step6(string mod, string equipment, string layer, string zone, string rds) =>
|
||||
View(new string[] { mod, equipment, layer, zone, rds });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Reactor")]
|
||||
[Route("/Metrology/Reactor")]
|
||||
public IActionResult Reactor() => View(new RunInfo());
|
||||
|
||||
[HttpGet]
|
||||
[Route("/WorkMaterial")]
|
||||
[Route("/Metrology/WorkMaterial")]
|
||||
public IActionResult WorkMaterial() => View();
|
||||
|
||||
}
|
33
Server/Data/Tests/Reactors-GetReactors.json
Normal file
33
Server/Data/Tests/Reactors-GetReactors.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"Results": [
|
||||
20,
|
||||
22,
|
||||
24,
|
||||
26,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
34,
|
||||
36,
|
||||
38,
|
||||
40,
|
||||
42,
|
||||
44,
|
||||
46,
|
||||
48,
|
||||
50,
|
||||
52,
|
||||
54,
|
||||
56,
|
||||
58,
|
||||
60,
|
||||
62,
|
||||
64,
|
||||
66,
|
||||
68,
|
||||
70,
|
||||
72,
|
||||
74
|
||||
],
|
||||
"TotalRows": 28
|
||||
}
|
280
Server/Data/Tests/WorkMaterial-GetCassette.json
Normal file
280
Server/Data/Tests/WorkMaterial-GetCassette.json
Normal file
@ -0,0 +1,280 @@
|
||||
{
|
||||
"Results": [
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 1,
|
||||
"Pocket": "1",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 2,
|
||||
"Pocket": "2",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 3,
|
||||
"Pocket": "3",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 4,
|
||||
"Pocket": "4",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 5,
|
||||
"Pocket": "5",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 6,
|
||||
"Pocket": "6",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 7,
|
||||
"Pocket": "7",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586337",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 8,
|
||||
"Pocket": "8",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 9,
|
||||
"Pocket": "1",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 10,
|
||||
"Pocket": "2",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 11,
|
||||
"Pocket": "3",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 12,
|
||||
"Pocket": "4",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 13,
|
||||
"Pocket": "5",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 14,
|
||||
"Pocket": "6",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 15,
|
||||
"Pocket": "7",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586345",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 16,
|
||||
"Pocket": "8",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 17,
|
||||
"Pocket": "1",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 18,
|
||||
"Pocket": "2",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 19,
|
||||
"Pocket": "3",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 20,
|
||||
"Pocket": "4",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 21,
|
||||
"Pocket": "5",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 22,
|
||||
"Pocket": "6",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 23,
|
||||
"Pocket": "7",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586347",
|
||||
"Reactor": 54,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 24,
|
||||
"Pocket": "8",
|
||||
"Zone": "1"
|
||||
},
|
||||
{
|
||||
"RunDataSheet": "586381",
|
||||
"Reactor": 52,
|
||||
"PSN": "4445",
|
||||
"RecipeName": "Phosphorus",
|
||||
"RecipeNumber": 743,
|
||||
"SpecType": "Production",
|
||||
"SlotNumber": 25,
|
||||
"Pocket": "1",
|
||||
"Zone": "1"
|
||||
}
|
||||
],
|
||||
"TotalRows": 25
|
||||
}
|
@ -28,7 +28,7 @@
|
||||
<PackageReference Include="Dapper" Version="2.0.123" />
|
||||
<PackageReference Include="EntityFramework" Version="6.4.4" />
|
||||
<PackageReference Include="jQuery" Version="3.6.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
|
||||
@ -122,6 +122,9 @@
|
||||
<None Include="Data\Tests\Pin-GetPinnedTable.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Tests\Reactors-GetReactors.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Tests\ServiceShopOrder-GetAllServiceShopOrders.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
@ -143,5 +146,8 @@
|
||||
<None Include="Data\Tests\ToolTypes-Index.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Tests\WorkMaterial-GetCassette.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -67,6 +67,7 @@ public class Program
|
||||
|
||||
_ = webApplicationBuilder.Services.AddSingleton(_ => appSettings);
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IInboundRepository, InboundRepository>();
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IReactorsRepository, ReactorsRepository>();
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IClientSettingsRepository>(_ => clientSettingsRepository);
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IServiceShopOrderRepository, ServiceShopOrderRepository>();
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IPinRepository, PinRepository>(_ => new(appSettings.MockRoot));
|
||||
@ -75,6 +76,7 @@ public class Program
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<Models.Binder.AppSettings>>(_ => appSettingsRepository);
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IInfinityQSRepository, InfinityQSRepository>(_ => new(appSettings.MockRoot, sqlDbConnectionFactory));
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IInfinityQSV2Repository, InfinityQSV2Repository>(_ => new(appSettings.MockRoot, sqlDbConnectionFactory));
|
||||
_ = webApplicationBuilder.Services.AddSingleton<IWorkMaterialRepository, WorkMaterialRepository>(_ => new(appSettings.MockRoot, sqlDbConnectionFactory));
|
||||
|
||||
_ = webApplicationBuilder.Services.AddScoped<IExportRepository, ExportRepository>();
|
||||
_ = webApplicationBuilder.Services.AddScoped<IAttachmentsService, AttachmentsService>();
|
||||
|
90
Server/Repositories/ReactorsRepository.cs
Normal file
90
Server/Repositories/ReactorsRepository.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using OI.Metrology.Shared.DataModels;
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
namespace OI.Metrology.Server.Repository;
|
||||
|
||||
public class ReactorsRepository : IReactorsRepository
|
||||
{
|
||||
|
||||
Result<int[]> IReactorsRepository.EvenReactors()
|
||||
{
|
||||
Result<int[]> results;
|
||||
int[] collection = new int[] {
|
||||
20,
|
||||
22,
|
||||
24,
|
||||
26,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
34,
|
||||
36,
|
||||
38,
|
||||
40,
|
||||
42,
|
||||
44,
|
||||
46,
|
||||
48,
|
||||
50,
|
||||
52,
|
||||
54,
|
||||
56,
|
||||
58,
|
||||
60,
|
||||
62,
|
||||
64,
|
||||
66,
|
||||
68,
|
||||
70,
|
||||
72,
|
||||
74
|
||||
};
|
||||
results = new()
|
||||
{
|
||||
Results = collection,
|
||||
TotalRows = collection.Length,
|
||||
};
|
||||
return results;
|
||||
}
|
||||
|
||||
Result<int[]> IReactorsRepository.OddReactors()
|
||||
{
|
||||
Result<int[]> results;
|
||||
int[] collection = new int[] {
|
||||
21,
|
||||
23,
|
||||
25,
|
||||
27,
|
||||
29,
|
||||
31,
|
||||
33,
|
||||
35,
|
||||
37,
|
||||
39,
|
||||
41,
|
||||
43,
|
||||
45,
|
||||
47,
|
||||
49,
|
||||
51,
|
||||
53,
|
||||
55,
|
||||
57,
|
||||
59,
|
||||
61,
|
||||
63,
|
||||
65,
|
||||
73,
|
||||
75,
|
||||
77,
|
||||
79
|
||||
};
|
||||
results = new()
|
||||
{
|
||||
Results = collection,
|
||||
TotalRows = collection.Length,
|
||||
};
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
158
Server/Repositories/WorkMaterialRepository.cs
Normal file
158
Server/Repositories/WorkMaterialRepository.cs
Normal file
@ -0,0 +1,158 @@
|
||||
using OI.Metrology.Shared.DataModels;
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using OI.Metrology.Shared.Repositories;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace OI.Metrology.Server.Repository;
|
||||
|
||||
public class WorkMaterialRepository : IWorkMaterialRepository
|
||||
{
|
||||
|
||||
private readonly string _MockRoot;
|
||||
private readonly string _RepositoryName;
|
||||
private readonly IDbConnectionFactory _DBConnectionFactory;
|
||||
|
||||
public WorkMaterialRepository(string mockRoot, IDbConnectionFactory dbConnectionFactory)
|
||||
{
|
||||
_MockRoot = mockRoot;
|
||||
_DBConnectionFactory = dbConnectionFactory;
|
||||
_RepositoryName = nameof(WorkMaterialRepository)[..^10];
|
||||
}
|
||||
|
||||
string IWorkMaterialRepository.GetCommandText(int? workOrderNumber, int? workOrderStep, int? workOrderCassette)
|
||||
{
|
||||
StringBuilder result = new();
|
||||
_ = result.Append("select ( ").
|
||||
Append(" select wm_b.slot_no, ").
|
||||
Append(" wm_b.rds_no, ").
|
||||
Append(" rr.reactor, ").
|
||||
Append(" wm_b.pocket_no, ").
|
||||
Append(" wm_b.zone, ").
|
||||
Append(" rr.ps_no, ").
|
||||
Append(" rr.recipe_name, ").
|
||||
Append(" rr.recipe_no, ").
|
||||
Append(" rr.spec_type ").
|
||||
Append(" from lsl2sql.dbo.wm_in_slot_no wm_b ").
|
||||
Append(" inner join lsl2sql.dbo.react_run rr ").
|
||||
Append(" on wm_b.wo_no = rr.wo_no ").
|
||||
Append(" and wm_b.rds_no = rr.rds_no ").
|
||||
Append(" where wm_b.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
|
||||
Append(" and wm_b.proc_step_no = ").Append(workOrderStep is null ? -1 : workOrderStep.Value).Append(' ').
|
||||
Append(" and wm_b.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append(" and wm_b.rds_no = wm.rds_no ").
|
||||
Append(" order by wm_b.slot_no ").
|
||||
Append(" for json path ").
|
||||
Append(" ) [group] ").
|
||||
Append("from lsl2sql.dbo.wm_in_slot_no wm ").
|
||||
Append("where wm.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
|
||||
Append(" and wm.proc_step_no = ").Append(workOrderStep is null ? -1 : workOrderStep.Value).Append(' ').
|
||||
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append("group by wm.rds_no ").
|
||||
Append("order by wm.rds_no ").
|
||||
Append("for json path ");
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
private static StringBuilder GetForJsonPath(IDbConnectionFactory dbConnectionFactory, string commandText)
|
||||
{
|
||||
StringBuilder stringBuilder = new();
|
||||
using DbConnection dbConnection = dbConnectionFactory.GetDbConnection(useOI2Sql: true);
|
||||
DbCommand dbCommand = dbConnection.CreateCommand();
|
||||
dbCommand.CommandText = commandText;
|
||||
DbDataReader dbDataReader = dbCommand.ExecuteReader(CommandBehavior.SequentialAccess);
|
||||
while (dbDataReader.Read())
|
||||
_ = stringBuilder.Append(dbDataReader.GetString(0));
|
||||
return stringBuilder;
|
||||
}
|
||||
|
||||
private static (int?, int?, int?, bool) GetWorkOrder(string mid)
|
||||
{
|
||||
int? workOrderStep = null;
|
||||
int? workOrderNumber = null;
|
||||
MatchCollection[] collection;
|
||||
int? workOrderCassette = null;
|
||||
if (string.IsNullOrEmpty(mid))
|
||||
collection = Array.Empty<MatchCollection>();
|
||||
else
|
||||
{
|
||||
string pattern = @"^([oiOI])?([0-9]{6,7})\.([0-5]{1})\.([0-9]{1,2})$"; // o171308.1.51
|
||||
collection = (from l in mid.Split('-') select Regex.Matches(l, pattern)).ToArray();
|
||||
}
|
||||
foreach (MatchCollection matchCollection in collection)
|
||||
{
|
||||
if (matchCollection.Count == 0)
|
||||
continue;
|
||||
if (!matchCollection[0].Success || matchCollection[0].Groups.Count != 5)
|
||||
continue;
|
||||
if (!int.TryParse(matchCollection[0].Groups[3].Value, out int workOrderStepValue))
|
||||
continue;
|
||||
if (!int.TryParse(matchCollection[0].Groups[2].Value, out int workOrderNumberValue))
|
||||
continue;
|
||||
if (!int.TryParse(matchCollection[0].Groups[4].Value, out int workOrderCassetteValue))
|
||||
continue;
|
||||
workOrderStep = workOrderStepValue;
|
||||
workOrderNumber = workOrderNumberValue;
|
||||
workOrderCassette = workOrderCassetteValue;
|
||||
break;
|
||||
}
|
||||
return new(workOrderNumber, workOrderStep, workOrderCassette, workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null);
|
||||
}
|
||||
|
||||
Result<WorkMaterialV2[]> IWorkMaterialRepository.GetCassette(string mid)
|
||||
{
|
||||
Result<WorkMaterialV2[]>? result;
|
||||
if (!string.IsNullOrEmpty(_MockRoot))
|
||||
{
|
||||
string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IWorkMaterialRepository.GetCassette)}.json"));
|
||||
result = JsonSerializer.Deserialize<Result<WorkMaterialV2[]>>(json);
|
||||
if (result is null)
|
||||
throw new NullReferenceException(nameof(result));
|
||||
}
|
||||
else
|
||||
{
|
||||
WorkMaterialV2[] results;
|
||||
(int? workOrderNumber, int? workOrderStep, int? workOrderCassette, bool isWorkOrder) = GetWorkOrder(mid);
|
||||
if (!isWorkOrder)
|
||||
results = Array.Empty<WorkMaterialV2>();
|
||||
else
|
||||
{
|
||||
WorkMaterial[]? group;
|
||||
JsonProperty[] jsonProperties;
|
||||
List<WorkMaterial> collection = new();
|
||||
IWorkMaterialRepository workMaterialRepository = this;
|
||||
string commandText = workMaterialRepository.GetCommandText(workOrderNumber, workOrderStep, workOrderCassette);
|
||||
StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(stringBuilder.ToString());
|
||||
if (jsonElements is null)
|
||||
throw new NullReferenceException(nameof(jsonElements));
|
||||
foreach (JsonElement jsonElement in jsonElements)
|
||||
{
|
||||
if (jsonElement.ValueKind != JsonValueKind.Object)
|
||||
continue;
|
||||
jsonProperties = jsonElement.EnumerateObject().ToArray();
|
||||
if (!jsonProperties.Any())
|
||||
continue;
|
||||
group = JsonSerializer.Deserialize<WorkMaterial[]>(jsonProperties.First().Value.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
||||
if (group is null)
|
||||
continue;
|
||||
foreach (WorkMaterial workMaterial in group)
|
||||
collection.Add(workMaterial);
|
||||
}
|
||||
if (collection is null)
|
||||
throw new NullReferenceException(nameof(collection));
|
||||
results = WorkMaterial.Convert(collection);
|
||||
}
|
||||
result = new()
|
||||
{
|
||||
Results = results,
|
||||
TotalRows = results.Length,
|
||||
};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -13,7 +13,7 @@ public class SQLDbConnectionFactory : IDbConnectionFactory
|
||||
|
||||
public SQLDbConnectionFactory(AppSettings appSettings) => _AppSettings = appSettings;
|
||||
|
||||
public DbConnection GetDbConnection()
|
||||
public DbConnection GetDbConnection(bool? useOI2Sql)
|
||||
{
|
||||
DbProviderFactories.RegisterFactory(
|
||||
typeof(SqlConnection).Namespace,
|
||||
@ -22,9 +22,12 @@ public class SQLDbConnectionFactory : IDbConnectionFactory
|
||||
if (string.IsNullOrEmpty(_AppSettings.ConnectionString))
|
||||
throw new Exception("Connection string is missing");
|
||||
|
||||
DbConnection c = SqlClientFactory.Instance.CreateConnection();
|
||||
c.ConnectionString = _AppSettings.ConnectionString;
|
||||
c.Open();
|
||||
return c;
|
||||
if (string.IsNullOrEmpty(_AppSettings.OI2SqlConnectionString))
|
||||
throw new Exception("Connection string is missing");
|
||||
|
||||
DbConnection dbConnection = SqlClientFactory.Instance.CreateConnection();
|
||||
dbConnection.ConnectionString = useOI2Sql is not null && useOI2Sql.Value ? _AppSettings.OI2SqlConnectionString : _AppSettings.ConnectionString;
|
||||
dbConnection.Open();
|
||||
return dbConnection;
|
||||
}
|
||||
}
|
52
Server/Views/Reactors/Reactor.cshtml
Normal file
52
Server/Views/Reactors/Reactor.cshtml
Normal file
@ -0,0 +1,52 @@
|
||||
@{
|
||||
ViewData["Title"] = "Reactor";
|
||||
}
|
||||
<style>
|
||||
#RunGridDiv,
|
||||
#DetailsGridDiv {
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h4>Reactor</h4>
|
||||
|
||||
<form class="form-inline mb-4">
|
||||
<div class="form-group" id="EvenReactorDiv">
|
||||
<button for="EvenReactor">Even Reactor</button>
|
||||
<label for="EvenReactor">Even Reactor</label>
|
||||
<div class="form-control" id="EvenReactor" hidden></div>
|
||||
</div>
|
||||
<div class="form-group" id="OddReactorDiv">
|
||||
<button for="OddReactor">Odd Reactor</button>
|
||||
<label for="OddReactor">Odd Reactor</label>
|
||||
<div class="form-control" id="OddReactor" hidden></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Load Runs" id="LoadRunsButton" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
|
||||
<div class="col-xs-1">
|
||||
<input type="button" class="btn" id="GetDataButton" value="Get Data" disabled />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
initReactor("@ViewBag.ApiUrl");
|
||||
|
||||
$("#EvenReactorDiv").prop("hidden", true);
|
||||
$("#OddReactorDiv").prop("hidden", true);
|
||||
|
||||
$("#RunGrid").on("dblclick", "tr", LoadDetails);
|
||||
|
||||
$("#LoadRunsButton").click(LoadRunGrid);
|
||||
|
||||
$("#GetDataButton").click(LoadDetails);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
96
Server/Views/Reactors/Step1.cshtml
Normal file
96
Server/Views/Reactors/Step1.cshtml
Normal file
@ -0,0 +1,96 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "Step 1";
|
||||
string side = Model[0] == "0" ? "Even" : "Odd";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model[5]))
|
||||
{
|
||||
<h3>@(side) - @(Model[1])</h3><br />
|
||||
<h3>__-@(Model[4])-____.@(Model[2])-@(Model[3])</h3><br />
|
||||
<h3>@(Model[5])</h3><br />
|
||||
}
|
||||
<h4>Step 1</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Side">Side:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Even" id="EvenButton" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Odd" id="OddButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-warning" type="button" value="Restart" id="RestartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function Submit(mod) {
|
||||
if (mod === 9) {
|
||||
window.location.href = '\Step1';
|
||||
}
|
||||
else {
|
||||
window.location.href = '\Step2?mod=' + mod;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#EvenButton").click(function () { Submit(0); });
|
||||
$("#OddButton").click(function () { Submit(1); });
|
||||
|
||||
$("#RestartButton").click(function () { Submit(9); });
|
||||
|
||||
});
|
||||
</script>
|
167
Server/Views/Reactors/Step2.cshtml
Normal file
167
Server/Views/Reactors/Step2.cshtml
Normal file
@ -0,0 +1,167 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "Step 2";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h4>Step 2</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Equipment">Equipment:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Tencor 1" id="Tencor1Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Tencor 2" id="Tencor2Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Tencor 3" id="Tencor3Button" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="HgCV 1" id="HgCV1Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="HgCV 2" id="HgCV2Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="HgCV 3" id="HgCV3Button" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="BioRad 2" id="BioRad2Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="BioRad 3" id="BioRad3Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="BioRad 4" id="BioRad4Button" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="CDE 2" id="CDE2Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="CDE 4" id="CDE4Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="CDE 5" id="CDE5Button" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Restart" id="RestartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function Submit(equipment) {
|
||||
if (equipment === 'RestartButton') {
|
||||
window.location.href = '\Step1';
|
||||
}
|
||||
else {
|
||||
window.location.href = '\Step3?mod=@(Model[0])&equipment=' + equipment;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#Tencor1Button").click(function () { Submit('Tencor1'); });
|
||||
$("#Tencor2Button").click(function () { Submit('Tencor2'); });
|
||||
$("#Tencor3Button").click(function () { Submit('Tencor3'); });
|
||||
|
||||
$("#HgCV1Button").click(function () { Submit('HgCV1'); });
|
||||
$("#HgCV2Button").click(function () { Submit('HgCV2'); });
|
||||
$("#HgCV3Button").click(function () { Submit('HgCV3'); });
|
||||
|
||||
$("#BioRad2Button").click(function () { Submit('BioRad2'); });
|
||||
$("#BioRad3Button").click(function () { Submit('BioRad3'); });
|
||||
$("#BioRad4Button").click(function () { Submit('BioRad4'); });
|
||||
|
||||
$("#CDE2Button").click(function () { Submit('CDE2'); });
|
||||
$("#CDE4Button").click(function () { Submit('CDE4'); });
|
||||
$("#CDE5Button").click(function () { Submit('CDE5'); });
|
||||
|
||||
$("#RestartButton").click(function () { Submit('RestartButton'); });
|
||||
|
||||
});
|
||||
</script>
|
95
Server/Views/Reactors/Step3.cshtml
Normal file
95
Server/Views/Reactors/Step3.cshtml
Normal file
@ -0,0 +1,95 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "Step 3";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h4>Step 3</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Layer">Layer:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Layer 1" id="Layer1Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Layer 2" id="Layer2Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Layer 3" id="Layer3Button" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-warning" type="button" value="Restart" id="RestartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function Submit(layer) {
|
||||
if (layer === 'RestartButton') {
|
||||
window.location.href = '\Step1';
|
||||
}
|
||||
else {
|
||||
window.location.href = '\Step4?mod=@(Model[0])&equipment=@(Model[1])&layer=' + layer;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#Layer1Button").click(function () { Submit('1'); });
|
||||
$("#Layer2Button").click(function () { Submit('2'); });
|
||||
$("#Layer3Button").click(function () { Submit('3'); });
|
||||
|
||||
$("#RestartButton").click(function () { Submit('RestartButton'); });
|
||||
|
||||
});
|
||||
</script>
|
115
Server/Views/Reactors/Step4.cshtml
Normal file
115
Server/Views/Reactors/Step4.cshtml
Normal file
@ -0,0 +1,115 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "Step 4";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h4>Step 4</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Zone">Zone:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Zone 1" id="Zone1Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Zone 2" id="Zone2Button" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Zone 3" id="Zone3Button" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<label for="NoZone">No Zone - RDS:</label>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="txt txt-primary" type="input" value="" id="RDSInput" /><br />
|
||||
<input class="btn btn-warning" type="button" value="Next" id="RDSButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-warning" type="button" value="Restart" id="RestartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function Submit(zone) {
|
||||
if (zone === 9) {
|
||||
window.location.href = '\Step1';
|
||||
}
|
||||
else if (zone > 9) {
|
||||
var rds = $("#RDSInput").val();
|
||||
window.location.href = '\Step6?mod=@(Model[0])&equipment=@(Model[1])&layer=@(Model[2])&zone=0&rds=' + rds;
|
||||
}
|
||||
else {
|
||||
window.location.href = '\Step5?mod=@(Model[0])&equipment=@(Model[1])&layer=@(Model[2])&zone=' + zone;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#Zone1Button").click(function () { Submit(1); });
|
||||
$("#Zone2Button").click(function () { Submit(2); });
|
||||
$("#Zone3Button").click(function () { Submit(3); });
|
||||
|
||||
$("#RDSButton").click(function () { Submit(123456); });
|
||||
|
||||
$("#RestartButton").click(function () { Submit(9); });
|
||||
|
||||
});
|
||||
</script>
|
89
Server/Views/Reactors/Step5.cshtml
Normal file
89
Server/Views/Reactors/Step5.cshtml
Normal file
@ -0,0 +1,89 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "Step 5";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h4>Step 5</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="RDS">RDS:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="txt txt-primary" type="input" value="" id="RDSInput" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Next" id="RDSButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-warning" type="button" value="Restart" id="RestartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function Submit(zone) {
|
||||
if (zone === 9) {
|
||||
window.location.href = '\Step1';
|
||||
}
|
||||
else {
|
||||
var rds = $("#RDSInput").val();
|
||||
window.location.href = '\Step6?mod=@(Model[0])&equipment=@(Model[1])&layer=@(Model[2])&zone=@(Model[3])&rds=' + rds;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#RDSButton").click(function () { Submit(123456); });
|
||||
|
||||
$("#RestartButton").click(function () { Submit(9); });
|
||||
|
||||
});
|
||||
</script>
|
89
Server/Views/Reactors/Step6.cshtml
Normal file
89
Server/Views/Reactors/Step6.cshtml
Normal file
@ -0,0 +1,89 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "Step 6";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h4>Step 6</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Initials">Initials:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="txt txt-primary" type="input" value="" id="InitialsInput" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="button" value="Next" id="InitialsButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-warning" type="button" value="Restart" id="RestartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
function Submit(initials) {
|
||||
if (initials === 'RestartButton') {
|
||||
window.location.href = '\Step1';
|
||||
}
|
||||
else {
|
||||
var initials = $("#InitialsInput").val();
|
||||
window.location.href = '\Step1?mod=@(Model[0])&equipment=@(Model[1])&layer=@(Model[2])&zone=@(Model[3])&rds=@(Model[4])&initials=' + initials;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#InitialsButton").click(function () { Submit('MP'); });
|
||||
|
||||
$("#RestartButton").click(function () { Submit('RestartButton'); });
|
||||
|
||||
});
|
||||
</script>
|
118
Server/Views/Reactors/WorkMaterial.cshtml
Normal file
118
Server/Views/Reactors/WorkMaterial.cshtml
Normal file
@ -0,0 +1,118 @@
|
||||
@model string[]
|
||||
@{
|
||||
ViewData["Title"] = "WM Out";
|
||||
}
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.container-fluid {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#HeaderGrid,
|
||||
#FieldsGrid {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.FieldTitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="scan">WM Out:</label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="username">Username:</label>
|
||||
</td>
|
||||
<td>
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="txt txt-primary" type="input" id="scan" value="" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="txt txt-primary" type="input" id="username" value="" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-warning" type="button" value="Restart" id="restartButton" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="zone1" value="Zone 1" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="zone2" value="Zone 2" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="layer1" value="Layer 1" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="layer2" value="Layer 2" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="layer3" value="Layer 3" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="runDataSheet1" value="" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="runDataSheet2" value="" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="runDataSheet3" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="runDataSheet4" value="" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="runDataSheet5" value="" />
|
||||
</td>
|
||||
<td>
|
||||
<input class="btn btn-primary" type="button" id="runDataSheet6" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div style="height: 300px;" id="cassetteGridDiv">
|
||||
<table id="cassetteGrid"></table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#zone1").click(function () { zone(1) });
|
||||
$("#zone2").click(function () { zone(2) });
|
||||
$("#layer1").click(function () { layer(1) });
|
||||
$("#layer2").click(function () { layer(2) });
|
||||
$("#layer3").click(function () { layer(3) });
|
||||
$("#runDataSheet1").click(function () { runDataSheet(1, $(this).val()) });
|
||||
$("#runDataSheet2").click(function () { runDataSheet(2, $(this).val()) });
|
||||
$("#runDataSheet3").click(function () { runDataSheet(3, $(this).val()) });
|
||||
$("#runDataSheet4").click(function () { runDataSheet(4, $(this).val()) });
|
||||
$("#runDataSheet5").click(function () { runDataSheet(5, $(this).val()) });
|
||||
$("#runDataSheet6").click(function () { runDataSheet(6, $(this).val()) });
|
||||
$("#restartButton").click(function () { restartButton() });
|
||||
initWorkMaterial("@ViewBag.ApiUrl");
|
||||
});
|
||||
</script>
|
@ -2,6 +2,7 @@ var _CdeId = null;
|
||||
var _apiUrl = null;
|
||||
var _BioRadId = null;
|
||||
var _toolType = null;
|
||||
var _workMaterial = {};
|
||||
var _initialHeaderId = null;
|
||||
var _toolTypeMetaData = null;
|
||||
var _initialHeaderAttachmentId = null;
|
||||
@ -473,7 +474,7 @@ function recipeParametersButtonRunInfo() {
|
||||
stringified = stringified.replace(/"Tool":/gm, '"MesEntity":');
|
||||
stringified = stringified.replace(/"Equipment ID":/gm, '"MesEntity":');
|
||||
var jsonObject = JSON.parse(stringified);
|
||||
DisplayWSMessage("info", "Recipe Parameters - Work In Progress ***", null);
|
||||
DisplayWSMessage("info", "Recipe Parameters", null);
|
||||
$("#ModalHeaderGrid").igGrid({
|
||||
dataSource: jsonObject,
|
||||
dataSourceType: 'json',
|
||||
@ -794,4 +795,155 @@ function copy() {
|
||||
|
||||
// Copy the text inside the text field
|
||||
navigator.clipboard.writeText(copyText.value);
|
||||
}
|
||||
}
|
||||
|
||||
function clearWorkMaterial() {
|
||||
_workMaterial = {};
|
||||
$("#scan").val("");
|
||||
$("#zone1").show();
|
||||
$("#zone1").show();
|
||||
$("#zone2").show();
|
||||
$("#layer1").show();
|
||||
$("#layer2").show();
|
||||
$("#layer3").show();
|
||||
$("#username").val("");
|
||||
$("#runDataSheet1").hide();
|
||||
$("#runDataSheet2").hide();
|
||||
$("#runDataSheet3").hide();
|
||||
$("#runDataSheet4").hide();
|
||||
$("#runDataSheet5").hide();
|
||||
$("#runDataSheet6").hide();
|
||||
$("#runDataSheet1").val("");
|
||||
$("#runDataSheet2").val("");
|
||||
$("#runDataSheet3").val("");
|
||||
$("#runDataSheet4").val("");
|
||||
$("#runDataSheet5").val("");
|
||||
$("#runDataSheet6").val("");
|
||||
var gridCreated = $("#cassetteGrid").data("igGrid");
|
||||
if (gridCreated)
|
||||
$("#cassetteGrid").igGrid("destroy");
|
||||
}
|
||||
|
||||
function postWorkMaterial() {
|
||||
var row = $("#cassetteGrid").igGrid("selectedRow");
|
||||
if (row == null)
|
||||
return;
|
||||
var data = $("#cassetteGrid").igGrid("findRecordByKey", row.id);
|
||||
if (data == null)
|
||||
return;
|
||||
if (!_workMaterial['layer'])
|
||||
ShowErrorMessage("Select layer and try agian");
|
||||
else {
|
||||
_workMaterial['psn'] = data.PSN;
|
||||
_workMaterial['pocket'] = data.Pocket;
|
||||
_workMaterial['reactor'] = data.Reactor;
|
||||
_workMaterial['slotNumber'] = data.SlotNumber;
|
||||
_workMaterial['runDataSheet'] = data.RunDataSheet;
|
||||
$.post(_apiUrl + "/api/Reactors/", _workMaterial, function (data) {
|
||||
DisplayWSMessage("info", "Data Saved use [" + data + "]", null);
|
||||
}).fail(function () {
|
||||
ShowErrorMessage("Error");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initWorkMaterial(apiUrl) {
|
||||
_apiUrl = apiUrl;
|
||||
$("#runDataSheet1").hide();
|
||||
$("#runDataSheet2").hide();
|
||||
$("#runDataSheet3").hide();
|
||||
$("#runDataSheet4").hide();
|
||||
$("#runDataSheet5").hide();
|
||||
$("#runDataSheet6").hide();
|
||||
};
|
||||
|
||||
function zone(zoneNumber) {
|
||||
var scan = $("#scan").val();
|
||||
_workMaterial['zone'] = zoneNumber;
|
||||
var username = $("#username").val();
|
||||
if (!scan || scan === "" || scan.length < 3 || scan[0] !== 'o') {
|
||||
ShowErrorMessage("Invalid WM Out");
|
||||
}
|
||||
else if (!username || username === "" || username.length < 2) {
|
||||
ShowErrorMessage("Invalid username");
|
||||
}
|
||||
else {
|
||||
$("#zone1").hide();
|
||||
$("#zone2").hide();
|
||||
_workMaterial['scan'] = scan;
|
||||
$("#zone" + zoneNumber).show();
|
||||
_workMaterial['username'] = username;
|
||||
$.getJSON(_apiUrl + "/api/WorkMaterial/" + scan + "/", function (data) {
|
||||
if (data.Results.length === 0)
|
||||
ShowErrorMessage("No data found");
|
||||
var filtered = [];
|
||||
for (var i = 0; i < data.Results.length; i++) {
|
||||
if (data.Results[i].Zone != zoneNumber)
|
||||
continue;
|
||||
filtered.push(data.Results[i]);
|
||||
}
|
||||
if (data.Results.length !== 0 && filtered.length === 0)
|
||||
ShowErrorMessage("All data filted");
|
||||
else {
|
||||
$("#cassetteGrid").igGrid({
|
||||
dataSource: filtered,
|
||||
primaryKey: "SlotNumber",
|
||||
features: [
|
||||
{ name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanged: postWorkMaterial },
|
||||
{ name: 'Resizing' },
|
||||
{ name: "Filtering", type: "local" },
|
||||
],
|
||||
});
|
||||
var distinct = [];
|
||||
for (var i = 0; i < filtered.length; i++) {
|
||||
if (distinct.indexOf(filtered[i].RunDataSheet) > -1)
|
||||
continue;
|
||||
distinct.push(filtered[i].RunDataSheet);
|
||||
}
|
||||
if (distinct.length > 0) {
|
||||
$("#runDataSheet1").val(distinct[0]);
|
||||
$("#runDataSheet1").show();
|
||||
}
|
||||
if (distinct.length > 1) {
|
||||
$("#runDataSheet2").val(distinct[1]);
|
||||
$("#runDataSheet2").show();
|
||||
}
|
||||
if (distinct.length > 2) {
|
||||
$("#runDataSheet3").val(distinct[2]);
|
||||
$("#runDataSheet3").show();
|
||||
}
|
||||
if (distinct.length > 3) {
|
||||
$("#runDataSheet4").val(distinct[3]);
|
||||
$("#runDataSheet4").show();
|
||||
}
|
||||
if (distinct.length > 4) {
|
||||
$("#runDataSheet5").val(distinct[4]);
|
||||
$("#runDataSheet5").show();
|
||||
}
|
||||
if (distinct.length > 5) {
|
||||
$("#runDataSheet6").val(distinct[4]);
|
||||
$("#runDataSheet6").show();
|
||||
}
|
||||
$("#cassetteGrid").on("dblclick", "tr", postWorkMaterial);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function layer(layerNumber) {
|
||||
$("#layer1").hide();
|
||||
$("#layer2").hide();
|
||||
$("#layer3").hide();
|
||||
$("#layer" + layerNumber).show();
|
||||
_workMaterial['layer'] = layerNumber;
|
||||
};
|
||||
|
||||
function runDataSheet(runDataSheetIndex) {
|
||||
var runDataSheet = $("#runDataSheet" + runDataSheetIndex).val();
|
||||
_workMaterial['runDataSheet'] = runDataSheet;
|
||||
$("#cassetteGrid").igGridFiltering("filter", ([{ fieldName: "RunDataSheet", expr: runDataSheet, cond: "equals" }]));
|
||||
};
|
||||
|
||||
function restartButton(apiUrl) {
|
||||
clearWorkMaterial();
|
||||
};
|
Reference in New Issue
Block a user