Exemplo n.º 1
0
        /// <summary>
        /// 同步集样罐信息到集中管控
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public void SyncBarrel(Action <string, eOutputType> output)
        {
            int res = 0;

            List <KY_CYJ_P_BARREL> infpdcybarrels = DcDbers.GetInstance().BeltSampler_Dber.Entities <KY_CYJ_P_BARREL>();

            foreach (KY_CYJ_P_BARREL entity in infpdcybarrels)
            {
                if (commonDAO.SaveEquInfSampleBarrel(new InfEquInfSampleBarrel
                {
                    BarrelNumber = entity.Barrel_Code,
                    BarrelStatus = entity.Down_Full == 1 ? "已满" : "未满".ToString(),
                    MachineCode = this.MachineCode,
                    InterfaceType = GlobalVars.InterfaceType_PDCYJ,
                    SampleCode = entity.Batch_Number,
                    InFactoryBatchId = commonDAO.GetBatchIdBySampleCode(entity.Barrel_Code),
                    SampleCount = entity.Down_Count,
                    UpdateTime = entity.End_Time,
                    BarrelType = "底卸式",
                }))
                {
                    res++;
                }
            }

            output(string.Format("同步集样罐记录 {0} 条", res), eOutputType.Normal);
        }