ProductionPlanEntity.cs 3.23 KB
using System;
using System.Collections.Generic;
using System.Linq;

namespace Hh.Mes.POJO.ApiEntity
{
    /// <summary>
    /// 生产订单 报工/计划
    /// </summary>
    public class ProductionPlanEntity
    {
        /// <summary>
        /// 当天生产量
        /// </summary>
        public OrderCount orderCountDay { get; set; }

        /// <summary>
        /// 当月生产量
        /// </summary>
        public OrderCount orderCountMonth { get; set; }

        /// <summary>
        /// 订单产品
        /// </summary>
        public Chart productWorkReportMonth { get; set; }

        /// <summary>
        /// 线体产品
        /// </summary>
        public Chart lineWorkReportMonth { get; set; }

        /// <summary>
        /// 生产订单
        /// </summary>
        public List<OrderList> orderList { get; set; } = new List<OrderList>();

        /// <summary>
        /// 订单物料消耗
        /// </summary>
        public List<OrderUseLoglist> orderUseLogList { get; set; } = new List<OrderUseLoglist>();
    }

    /// <summary>
    /// 生产量
    /// </summary>
    public class OrderCount
    {
        /// <summary>
        /// 接收
        /// </summary>
        public int receive { get; set; }

        /// <summary>
        /// 已报
        /// </summary>
        public int receiveComplete { get; set; }

        /// <summary>
        /// 百分比
        /// </summary>
        public string rate => receive == 0 ? "0" : $"{receiveComplete * 100 / receive}";
    }

    public class Chart
    {
        /// <summary>
        /// X轴名称集合
        /// </summary>
        public List<string> xAxisData { get; set; } = new List<string>();

        /// <summary>
        /// Y轴数值集合
        /// </summary>
        public List<int> yAxisQty { get; set; } = new List<int>();

        /// <summary>
        /// 总计
        /// </summary>
        public int yAxisQtyCount => yAxisQty.Sum();
    }

    /// <summary>
    /// 生产订单
    /// </summary>
    public class OrderList
    {
        public string workOrderCode { get; set; }
        public string lineName { get; set; }
        public string nowOprSequenceCode { get; set; }
        public string nowStationName { get; set; }
        public string state { get; set; }

        /// <summary>
        /// 计划/实际 开始时间
        /// </summary>
        public DateTime? startTime { get; set; }

        /// <summary>
        /// 计划/时间 结束时间
        /// </summary>
        public DateTime? endTime { get; set; }

        /// <summary>
        /// 订单创建时间
        /// </summary>
        public DateTime? createTime { get; set; }
    }

    /// <summary>
    /// 订单物料消耗
    /// </summary>
    public class OrderUseLoglist
    {
        public string workOrderCode { get; set; }
        public string lineName { get; set; }
        public string nowOprSequenceCode { get; set; }
        public string nowStationName { get; set; }
        public string productName { get; set; }
        public string materialCode { get; set; }
        public string materialName { get; set; }
        public string state { get; set; }
        public decimal? specifications { get; set; }
        public string unit { get; set; }
    }
}