add interface for FW for the CUST tool
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
</site>
|
||||
<site name="MeterProcessState" id="2">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\laa_production\Common\Service\MeterProcessState" />
|
||||
<virtualDirectory path="/" physicalPath="C:\ProgrammeSensus\Repo\Lab\La_Operations\laa_production\Common\Service\MeterProcessState" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1a3d4919c9c702245832d925951f2b7cb72fc333
|
||||
46bd00889699f5a20a4981a22f62b66368323855
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.FW
|
||||
{
|
||||
public class CordonelFw
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int Frequency { get; set; }
|
||||
|
||||
public int AppID { get; set; }
|
||||
|
||||
public int Version { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string FileName { get; set; }
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
|
||||
public bool ForPressure { get; set; }
|
||||
public int Metersize { get; set; }
|
||||
public int? LutFileID { get; set; }
|
||||
public Region Region { get; set; }
|
||||
public bool CurrentForProd { get; set; }
|
||||
public int? FileClusterStoreId { get; set; }
|
||||
|
||||
public bool IsDeleted() { return DeletedDate.HasValue; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
|
||||
{
|
||||
public enum Region
|
||||
{
|
||||
EMEA,
|
||||
NA,
|
||||
China
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Csd\CsdParameterResult.cs" />
|
||||
<Compile Include="File\BaseFile.cs" />
|
||||
<Compile Include="FW\CordonelFw.cs" />
|
||||
<Compile Include="FW\CordonelFWTypeEnum.cs" />
|
||||
<Compile Include="IProductionData.cs" />
|
||||
<Compile Include="KitronTestResults\JsonObject.cs" />
|
||||
@@ -95,6 +96,7 @@
|
||||
<Compile Include="OrderData\OrderOverViewCordonel.cs" />
|
||||
<Compile Include="OrderData\OrderRadioParameter.cs" />
|
||||
<Compile Include="OrderData\OrderProgrammingParameters.cs" />
|
||||
<Compile Include="OrderData\Region.cs" />
|
||||
<Compile Include="OrderData\ScanToSerialNr.cs" />
|
||||
<Compile Include="OrderState.cs" />
|
||||
<Compile Include="ProcessState\PressureTestResult.cs" />
|
||||
|
||||
@@ -457,6 +457,139 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retruns filted FW files for Cordonel without content
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("GetCorondelFw"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetCorondelFw(Int32? Metersize = null, int? Frequency = null, String Region = null, Boolean? ForProd = null , Boolean? Deleted = false)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
var ret = new List<CordonelFw>();
|
||||
|
||||
|
||||
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
|
||||
sb.AppendLine($" SELECT [CordonelCurrentFw_ID] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_Frequency] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_AppID] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_Version] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_Name] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_Deleted] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_ForPressure] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_Metersize] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_LutFileID] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_Region] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_CurrentForProd] ");
|
||||
sb.AppendLine($" ,[CordonelCurrentFw_FileClusterStoreId] ");
|
||||
sb.AppendLine($" ,[FileName] ");
|
||||
sb.AppendLine($" FROM[Auftrag].[dbo].[Cordonel_CurrentFw] ");
|
||||
sb.AppendLine($" left outer join [Auftrag].[dbo].[FileClusterStore] on [FileId] = [CordonelCurrentFw_FileClusterStoreId]");
|
||||
sb.AppendLine($" where 1= 1 ");
|
||||
if (Metersize.HasValue)
|
||||
{
|
||||
sb.AppendLine($" and CordonelCurrentFw_Metersize= {Metersize.Value} ");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Region))
|
||||
{
|
||||
sb.AppendLine($" and CordonelCurrentFw_Region ='{Region}' ");
|
||||
}
|
||||
if (ForProd.HasValue)
|
||||
{
|
||||
sb.AppendLine($" and CordonelCurrentFw_CurrentForProd ={(ForProd.Value ? "1" : "0") } ");
|
||||
}
|
||||
if (Deleted.HasValue)
|
||||
{
|
||||
sb.AppendLine($" and CordonelCurrentFw_Deleted is {(Deleted.Value ? "not" : "")} null");
|
||||
}
|
||||
|
||||
var retDT = dataacces.ExecuteQuery(sb.ToString());
|
||||
|
||||
foreach (DataRow item in retDT.Rows)
|
||||
{
|
||||
|
||||
var add = new CordonelFw() { Id = (int)item["CordonelCurrentFw_ID"] };
|
||||
add.Frequency = (int)item["CordonelCurrentFw_Frequency"];
|
||||
add.Name = (string)item["CordonelCurrentFw_Name"];
|
||||
|
||||
add.FileName = "";
|
||||
|
||||
if (item["FileName"].GetType() != typeof(DBNull))
|
||||
{
|
||||
add.FileName = (string)item["FileName"];
|
||||
}
|
||||
|
||||
|
||||
if (item["CordonelCurrentFw_Deleted"].GetType() != typeof(DBNull))
|
||||
{
|
||||
add.DeletedDate = (DateTime)item["CordonelCurrentFw_Deleted"];
|
||||
}
|
||||
|
||||
add.AppID = (int)item["CordonelCurrentFw_AppID"];
|
||||
add.Version = (int)item["CordonelCurrentFw_Version"];
|
||||
|
||||
add.Metersize = (Int16)item["CordonelCurrentFw_Metersize"];
|
||||
add.LutFileID = null;
|
||||
if (item["CordonelCurrentFw_LutFileID"].GetType() != typeof(DBNull))
|
||||
{
|
||||
add.LutFileID = (Int16)item["CordonelCurrentFw_LutFileID"];
|
||||
}
|
||||
|
||||
add.FileClusterStoreId = null;
|
||||
if (item["CordonelCurrentFw_FileClusterStoreId"].GetType() != typeof(DBNull))
|
||||
{
|
||||
add.FileClusterStoreId = (int)item["CordonelCurrentFw_FileClusterStoreId"];
|
||||
}
|
||||
add.CurrentForProd = false;
|
||||
if (item["CordonelCurrentFw_CurrentForProd"].GetType() != typeof(DBNull))
|
||||
{
|
||||
|
||||
add.CurrentForProd = (bool)item["CordonelCurrentFw_CurrentForProd"];
|
||||
}
|
||||
|
||||
|
||||
switch ((string)item["CordonelCurrentFw_Region"].ToString())
|
||||
{
|
||||
case "emea":
|
||||
add.Region = Logic.ProductionOrderCore.OrderData.Region.EMEA;
|
||||
break;
|
||||
case "na":
|
||||
add.Region = Logic.ProductionOrderCore.OrderData.Region.NA;
|
||||
break;
|
||||
case "china":
|
||||
add.Region = Logic.ProductionOrderCore.OrderData.Region.China;
|
||||
break;
|
||||
default:
|
||||
add.Region = Logic.ProductionOrderCore.OrderData.Region.EMEA;
|
||||
break;
|
||||
}
|
||||
ret.Add(add);
|
||||
}
|
||||
return Request.CreateResponse(HttpStatusCode.OK, ret);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all Fw Files (FileCategoryID = 1) that match the filters and are not deleted
|
||||
/// </summary>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
f64d563def603c89cafafa61a3219ba97e1e344c
|
||||
81d60b90addc793525740e9993e19bf6665bd401
|
||||
|
||||
Reference in New Issue
Block a user