|
@@ -6,80 +6,6 @@ using System.Text;
|
|
|
|
|
|
|
|
namespace Comal.Classes
|
|
namespace Comal.Classes
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
- public class StagingSetoutFormsAggregate : CoreAggregate<StagingSetout, StagingSetoutForm, Guid>
|
|
|
|
|
- {
|
|
|
|
|
- public override Expression<Func<StagingSetoutForm, Guid>> Aggregate => x => x.ID;
|
|
|
|
|
-
|
|
|
|
|
- public override AggregateCalculation Calculation => AggregateCalculation.Count;
|
|
|
|
|
-
|
|
|
|
|
- public override Dictionary<Expression<Func<StagingSetoutForm, object>>, Expression<Func<StagingSetout, object>>> Links =>
|
|
|
|
|
- new Dictionary<Expression<Func<StagingSetoutForm, object>>, Expression<Func<StagingSetout, object>>>()
|
|
|
|
|
- {
|
|
|
|
|
- { form => form.Parent.ID, setout => setout.ID }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public class StagingSetoutOpenFormsAggregate : CoreAggregate<StagingSetout, StagingSetoutForm, Guid>
|
|
|
|
|
- {
|
|
|
|
|
- public override Expression<Func<StagingSetoutForm, Guid>> Aggregate => x => x.ID;
|
|
|
|
|
-
|
|
|
|
|
- public override AggregateCalculation Calculation => AggregateCalculation.Count;
|
|
|
|
|
-
|
|
|
|
|
- public override Filter<StagingSetoutForm>? Filter =>
|
|
|
|
|
- Filter<StagingSetoutForm>.Where(x => x.FormCompleted).IsEqualTo(DateTime.MinValue);
|
|
|
|
|
-
|
|
|
|
|
- public override Dictionary<Expression<Func<StagingSetoutForm, object>>, Expression<Func<StagingSetout, object>>> Links =>
|
|
|
|
|
- new Dictionary<Expression<Func<StagingSetoutForm, object>>, Expression<Func<StagingSetout, object>>>()
|
|
|
|
|
- {
|
|
|
|
|
- { form => form.Parent.ID, setout => setout.ID }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public class StagingSetoutPacketsAggregate : CoreAggregate<StagingSetout, StagingManufacturingPacket, Guid>
|
|
|
|
|
- {
|
|
|
|
|
- public override Expression<Func<StagingManufacturingPacket, Guid>> Aggregate => x => x.ID;
|
|
|
|
|
-
|
|
|
|
|
- public override AggregateCalculation Calculation => AggregateCalculation.Count;
|
|
|
|
|
-
|
|
|
|
|
- public override Dictionary<Expression<Func<StagingManufacturingPacket, object>>, Expression<Func<StagingSetout, object>>> Links =>
|
|
|
|
|
- new Dictionary<Expression<Func<StagingManufacturingPacket, object>>, Expression<Func<StagingSetout, object>>>()
|
|
|
|
|
- {
|
|
|
|
|
- { packet => packet.StagingSetout.ID, setout => setout.ID }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public class StagingSetoutUnprocessedPacketsAggregate : CoreAggregate<StagingSetout, StagingManufacturingPacket, Guid>
|
|
|
|
|
- {
|
|
|
|
|
- public override Expression<Func<StagingManufacturingPacket, Guid>> Aggregate => x => x.ID;
|
|
|
|
|
-
|
|
|
|
|
- public override AggregateCalculation Calculation => AggregateCalculation.Count;
|
|
|
|
|
-
|
|
|
|
|
- public override Filter<StagingManufacturingPacket>? Filter =>
|
|
|
|
|
- Filter<StagingManufacturingPacket>.Where(x => x.ManufacturingPacket.ID).IsEqualTo(Guid.Empty);
|
|
|
|
|
-
|
|
|
|
|
- public override Dictionary<Expression<Func<StagingManufacturingPacket, object>>, Expression<Func<StagingSetout, object>>> Links =>
|
|
|
|
|
- new Dictionary<Expression<Func<StagingManufacturingPacket, object>>, Expression<Func<StagingSetout, object>>>()
|
|
|
|
|
- {
|
|
|
|
|
- { packet => packet.StagingSetout.ID, setout => setout.ID }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public class StagingUnapprovedDocumentsAggregate : CoreAggregate<StagingSetout, StagingSetoutDocument, Guid>
|
|
|
|
|
- {
|
|
|
|
|
- public override Expression<Func<StagingSetoutDocument, Guid>> Aggregate => x => x.ID;
|
|
|
|
|
-
|
|
|
|
|
- public override AggregateCalculation Calculation => AggregateCalculation.Count;
|
|
|
|
|
-
|
|
|
|
|
- public override Filter<StagingSetoutDocument>? Filter => Filter<StagingSetoutDocument>.Where(x => x.Approved).IsEqualTo(false);
|
|
|
|
|
-
|
|
|
|
|
- public override Dictionary<Expression<Func<StagingSetoutDocument, object>>, Expression<Func<StagingSetout, object>>> Links =>
|
|
|
|
|
- new Dictionary<Expression<Func<StagingSetoutDocument, object>>, Expression<Func<StagingSetout, object>>>()
|
|
|
|
|
- {
|
|
|
|
|
- { doc => doc.EntityLink.ID, setout => setout.ID }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public class StagingSetout : Entity, IPersistent, IRemotable, ILicense<ManufacturingLicense>, IJobScopedItem
|
|
public class StagingSetout : Entity, IPersistent, IRemotable, ILicense<ManufacturingLicense>, IJobScopedItem
|
|
|
{
|
|
{
|
|
|
[EditorSequence(1)]
|
|
[EditorSequence(1)]
|
|
@@ -118,16 +44,39 @@ namespace Comal.Classes
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
public EmployeeLink LockedBy { get; set; }
|
|
public EmployeeLink LockedBy { get; set; }
|
|
|
|
|
|
|
|
|
|
+ private class PacketsAggregate : ComplexFormulaGenerator<StagingSetout, int>
|
|
|
|
|
+ {
|
|
|
|
|
+ public override IComplexFormulaNode<StagingSetout, int> GetFormula() =>
|
|
|
|
|
+ Count<StagingManufacturingPacket, Guid>(
|
|
|
|
|
+ x => x.Property(x => x.ID))
|
|
|
|
|
+ .WithLink(x => x.StagingSetout.ID, x => x.ID);
|
|
|
|
|
+ }
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
- [Aggregate(typeof(StagingSetoutPacketsAggregate))]
|
|
|
|
|
|
|
+ [ComplexFormula(typeof(PacketsAggregate))]
|
|
|
public int Packets { get; set; }
|
|
public int Packets { get; set; }
|
|
|
|
|
|
|
|
|
|
+ private class UnprocessedPacketsAggregate : ComplexFormulaGenerator<StagingSetout, int>
|
|
|
|
|
+ {
|
|
|
|
|
+ public override IComplexFormulaNode<StagingSetout, int> GetFormula() =>
|
|
|
|
|
+ Count<StagingManufacturingPacket, Guid>(
|
|
|
|
|
+ x => x.Property(x => x.ID),
|
|
|
|
|
+ Filter<StagingManufacturingPacket>.Where(x => x.ManufacturingPacket.ID).IsEqualTo(Guid.Empty))
|
|
|
|
|
+ .WithLink(x => x.StagingSetout.ID, x => x.ID);
|
|
|
|
|
+ }
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
- [Aggregate(typeof(StagingSetoutUnprocessedPacketsAggregate))]
|
|
|
|
|
|
|
+ [ComplexFormula(typeof(UnprocessedPacketsAggregate))]
|
|
|
public int UnprocessedPackets { get; set; }
|
|
public int UnprocessedPackets { get; set; }
|
|
|
|
|
|
|
|
|
|
+ private class UnapprovedDocumentsAggregate : ComplexFormulaGenerator<StagingSetout, int>
|
|
|
|
|
+ {
|
|
|
|
|
+ public override IComplexFormulaNode<StagingSetout, int> GetFormula() =>
|
|
|
|
|
+ Count<StagingSetoutDocument, Guid>(
|
|
|
|
|
+ x => x.Property(x => x.ID),
|
|
|
|
|
+ Filter<StagingSetoutDocument>.Where(x => x.Approved).IsEqualTo(false))
|
|
|
|
|
+ .WithLink(x => x.EntityLink.ID, x => x.ID);
|
|
|
|
|
+ }
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
- [Aggregate(typeof(StagingUnapprovedDocumentsAggregate))]
|
|
|
|
|
|
|
+ [ComplexFormula(typeof(UnapprovedDocumentsAggregate))]
|
|
|
public int UnapprovedDocuments { get; set; }
|
|
public int UnapprovedDocuments { get; set; }
|
|
|
|
|
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
@@ -136,13 +85,27 @@ namespace Comal.Classes
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
public KanbanLink Task { get; set; }
|
|
public KanbanLink Task { get; set; }
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ private class FormsAggregate : ComplexFormulaGenerator<StagingSetout, int>
|
|
|
|
|
+ {
|
|
|
|
|
+ public override IComplexFormulaNode<StagingSetout, int> GetFormula() =>
|
|
|
|
|
+ Count<StagingSetoutForm, Guid>(
|
|
|
|
|
+ x => x.Property(x => x.ID))
|
|
|
|
|
+ .WithLink(x => x.Parent.ID, x => x.ID);
|
|
|
|
|
+ }
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
- [Aggregate(typeof(StagingSetoutFormsAggregate))]
|
|
|
|
|
|
|
+ [ComplexFormula(typeof(FormsAggregate))]
|
|
|
public int Forms { get; set; }
|
|
public int Forms { get; set; }
|
|
|
|
|
|
|
|
|
|
+ private class OpenFormsAggregate : ComplexFormulaGenerator<StagingSetout, int>
|
|
|
|
|
+ {
|
|
|
|
|
+ public override IComplexFormulaNode<StagingSetout, int> GetFormula() =>
|
|
|
|
|
+ Count<StagingSetoutForm, Guid>(
|
|
|
|
|
+ x => x.Property(x => x.ID),
|
|
|
|
|
+ Filter<StagingSetoutForm>.Where(x => x.FormCompleted).IsEqualTo(DateTime.MinValue))
|
|
|
|
|
+ .WithLink(x => x.Parent.ID, x => x.ID);
|
|
|
|
|
+ }
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
|
- [Aggregate(typeof(StagingSetoutOpenFormsAggregate))]
|
|
|
|
|
|
|
+ [ComplexFormula(typeof(OpenFormsAggregate))]
|
|
|
public int OpenForms { get; set; }
|
|
public int OpenForms { get; set; }
|
|
|
|
|
|
|
|
private class JobScopeLookup : LookupDefinitionGenerator<JobScope, StagingSetout>
|
|
private class JobScopeLookup : LookupDefinitionGenerator<JobScope, StagingSetout>
|