feat(ocp): create and book in plus dyco controller implemented
This commit is contained in:
9
server/services/sqlServer/querys/ocp/machineId.ts
Normal file
9
server/services/sqlServer/querys/ocp/machineId.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const machineCheck = `
|
||||
SELECT [HumanReadableId]
|
||||
,[Name]
|
||||
,[Location]
|
||||
,[Active]
|
||||
,[ImportSource]
|
||||
,[StagingMainMaterialMandatory]
|
||||
FROM [test1_AlplaPROD2.0_Read].[masterData].[Machine] (nolock)
|
||||
where Active = 1 and [Location] = [loc]`;
|
||||
17
server/services/sqlServer/querys/ocp/mainMaterial.ts
Normal file
17
server/services/sqlServer/querys/ocp/mainMaterial.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export const mmQuery = `
|
||||
SELECT lot.ProductionLotHumanReadableId,
|
||||
case when SourcingState in (1, 2) then 1
|
||||
when x.ProvidedAmount > 0 then 1
|
||||
when x.EffectiveConsumption > 0 then 1
|
||||
else 0 end as Staged,
|
||||
x.ProvidedAmount as Provided,
|
||||
x.EffectiveConsumption as consumption,
|
||||
x.IsManualProcess as isManual,
|
||||
MaterialHumanReadableId
|
||||
FROM [test1_AlplaPROD2.0_Read].[issueMaterial].[MaterialDemand] x (nolock)
|
||||
left join
|
||||
[test1_AlplaPROD2.0_Read].[issueMaterial].[ProductionLot] as lot on
|
||||
x.ProductionLotId = lot.Id
|
||||
where lot.ProductionLotHumanReadableId = [lotNumber]
|
||||
and IsMainMaterial = 1
|
||||
`;
|
||||
Reference in New Issue
Block a user