private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
 {
     foreach (GridRow gridRow in e.GridPanel.Rows)
     {
         CmcsBuyFuelTransport entity = gridRow.DataItem as CmcsBuyFuelTransport;
         if (entity == null)
         {
             return;
         }
         //gridRow.Cells["KsWeight"].Value = entity.KsWeight + entity.AutoKsWeight;
     }
 }
        /// <summary>
        /// 保存运输记录
        /// </summary>
        /// <returns></returns>
        bool SaveBuyFuelTransport()
        {
            CmcsAutotruck autoTruck = commonDAO.SelfDber.Entity <CmcsAutotruck>("where CarNumber=:CarNumber", new { CarNumber = this.txt_CarNumber.Text });

            if (autoTruck == null)
            {
                autoTruck = new CmcsAutotruck()
                {
                    CarNumber = this.txt_CarNumber.Text
                };
                commonDAO.SelfDber.Insert(autoTruck);
            }
            this.CurrentAutotruck = autoTruck;
            try
            {
                if (this.CurrentBuyFuelTransport == null)
                {
                    // 查找该车未完成的运输记录
                    CmcsUnFinishTransport unFinishTransport = carTransportDAO.GetUnFinishTransportByAutotruckId(this.CurrentAutotruck.Id, eCarType.入场煤.ToString());

                    if (unFinishTransport != null)
                    {
                        this.CurrentBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(unFinishTransport.TransportId);
                    }
                    else
                    {
                        CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport();
                        QueuerDAO.GetInstance().JoinQueueBuyFuelTransport(autoTruck, this.SelectedMine_BuyFuel, this.SelectedFuelKind_BuyFuel, Convert.ToDecimal(this.txtTicketWeight_BuyFuel.Value), DateTime.Now, "", ref transport);
                        this.CurrentBuyFuelTransport = transport;
                    }
                }
                this.CurrentBuyFuelTransport.KgWeight     = (decimal)this.txtKgWeight_BuyFuel.Value;
                this.CurrentBuyFuelTransport.KsWeight     = (decimal)this.txtKsWeight_BuyFuel.Value;
                this.CurrentBuyFuelTransport.DeductWeight = (decimal)this.txtKgWeight_BuyFuel.Value + (decimal)this.txtKsWeight_BuyFuel.Value;
                if (weighterDAO.SaveBuyFuelTransportHand(this.CurrentBuyFuelTransport, (decimal)Hardwarer.Wber.Weight, DateTime.Now, CommonAppConfig.GetInstance().AppIdentifier))
                {
                    this.CurrentBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(this.CurrentBuyFuelTransport.Id);

                    LoadTodayUnFinishBuyFuelTransport();
                    LoadTodayFinishBuyFuelTransport();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("保存失败\r\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);

                Log4Neter.Error("保存运输记录", ex);
            }

            return(false);
        }
        /// <summary>
        /// 窗体加载绑定数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmBuyFuelTransport_Oper_Load(object sender, EventArgs e)
        {
            //绑定煤种信息
            cmbFuelName_BuyFuel.DisplayMember = "Name";
            cmbFuelName_BuyFuel.ValueMember   = "Id";
            cmbFuelName_BuyFuel.DataSource    = Dbers.GetInstance().SelfDber.Entities <CmcsFuelKind>("where IsStop=0 and ParentId is not null");
            cmbFuelName_BuyFuel.SelectedIndex = 0;

            BindStepName();
            LoadHeavyWeight(cmbHeavyWeight);

            this.CmcsBuyFuelTransport = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(this.PId);
            if (this.CmcsBuyFuelTransport != null)
            {
                txt_SerialNumber.Text = CmcsBuyFuelTransport.SerialNumber;
                txt_CarNumber.Text    = CmcsBuyFuelTransport.CarNumber;
                CmcsInFactoryBatch cmcsinfactorybatch = Dbers.GetInstance().SelfDber.Get <CmcsInFactoryBatch>(CmcsBuyFuelTransport.InFactoryBatchId);
                if (cmcsinfactorybatch != null)
                {
                    txt_InFactoryBatchNumber.Text = cmcsinfactorybatch.Batch;
                }
                txt_SupplierName.Text         = CmcsBuyFuelTransport.SupplierName;
                txt_TransportCompanyName.Text = CmcsBuyFuelTransport.TransportCompanyName;
                txt_MineName.Text             = CmcsBuyFuelTransport.MineName;
                cmbFuelName_BuyFuel.Text      = CmcsBuyFuelTransport.FuelKindName;
                dbi_TicketWeight.Value        = (double)CmcsBuyFuelTransport.TicketWeight;
                dbi_GrossWeight.Value         = (double)CmcsBuyFuelTransport.GrossWeight;
                dbi_TareWeight.Value          = (double)CmcsBuyFuelTransport.TareWeight;
                dbi_DeductWeight.Value        = (double)CmcsBuyFuelTransport.DeductWeight;
                dbi_SuttleWeight.Value        = (double)CmcsBuyFuelTransport.SuttleWeight;
                cmbHeavyWeight.Text           = CmcsBuyFuelTransport.HeavyWeight;
                txtShipNumber.Text            = CmcsBuyFuelTransport.ShipName;
                txt_InFactoryTime.Text        = CmcsBuyFuelTransport.InFactoryTime.Year == 1 ? "" : CmcsBuyFuelTransport.InFactoryTime.ToString();
                txt_SamplingTime.Text         = CmcsBuyFuelTransport.SamplingTime.Year == 1 ? "" : CmcsBuyFuelTransport.SamplingTime.ToString();
                txt_GrossTime.Text            = CmcsBuyFuelTransport.GrossTime.Year == 1 ? "" : CmcsBuyFuelTransport.GrossTime.ToString();
                txt_UploadTime.Text           = CmcsBuyFuelTransport.UploadTime.Year == 1 ? "" : CmcsBuyFuelTransport.UploadTime.ToString();
                txt_TareTime.Text             = CmcsBuyFuelTransport.TareTime.Year == 1 ? "" : CmcsBuyFuelTransport.TareTime.ToString();
                txt_OutFactoryTime.Text       = CmcsBuyFuelTransport.OutFactoryTime.Year == 1 ? "" : CmcsBuyFuelTransport.OutFactoryTime.ToString();
                txt_Remark.Text      = CmcsBuyFuelTransport.Remark;
                chb_IsFinish.Checked = (CmcsBuyFuelTransport.IsFinish == 1);
                chb_IsUse.Checked    = (CmcsBuyFuelTransport.IsUse == 1);
                cmbStepName.Text     = CmcsBuyFuelTransport.StepName;
                this.CmcsAutotruck   = commonDAO.SelfDber.Get <CmcsAutotruck>(CmcsBuyFuelTransport.AutotruckId);
                ShowDeduct(this.CmcsBuyFuelTransport.Id);
            }

            if (this.EditMode == eEditMode.查看)
            {
                btnSubmit.Enabled = false;
                HelperUtil.ControlReadOnly(panelEx2, true);
            }
        }
 private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
 {
     foreach (GridRow gridRow in e.GridPanel.Rows)
     {
         View_BuyFuelTransport entity = gridRow.DataItem as View_BuyFuelTransport;
         if (entity == null)
         {
             return;
         }
         CmcsBuyFuelTransport entity2 = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(entity.Id);
         gridRow.Cells["clmKsWeight"].Value = entity2.AutoKsWeight + entity2.KsWeight;
     }
 }
 public void Print(CmcsBuyFuelTransport buyfueltransport)
 {
     _BuyFuelTransport = buyfueltransport;
     try
     {
         this._PrintDocument.Print();
     }
     catch
     {
         MessageBoxEx.Show("打印异常,请检查打印机!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     _BuyFuelTransport = null;
 }
        private void tsmiPrint_Click(object sender, EventArgs e)
        {
            GridRow gridRow = superGridControl1.PrimaryGrid.ActiveRow as GridRow;

            if (gridRow == null)
            {
                return;
            }
            CmcsBuyFuelTransport entity = gridRow.DataItem as CmcsBuyFuelTransport;
            FrmPrintWeb          frm    = new FrmPrintWeb(entity);

            frm.ShowDialog();
        }
Beispiel #7
0
 private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
 {
     foreach (GridRow item in e.GridPanel.Rows)
     {
         try
         {
             CmcsBuyFuelTransport entity = item.DataItem as CmcsBuyFuelTransport;
         }
         catch (Exception)
         {
         }
     }
 }
Beispiel #8
0
        /// <summary>
        /// 根据来煤预报生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck">车辆信息</param>
        /// <param name="lmyb">来煤预报</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsLMYB lmyb, DateTime inFactoryTime)
        {
            CmcsLMYBDetail lmybDetail = commonDAO.SelfDber.Entity <CmcsLMYBDetail>("where CarNumber=:CarNumber and LMYBId=:LMYBId", new { CarNumber = autotruck.CarNumber, LMYBId = lmyb.Id });

            if (lmybDetail == null)
            {
                return(false);
            }
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber       = carTransportDAO.CreateNewTransportSerialNumber(eTransportType.原料煤入场, inFactoryTime),
                AutotruckId        = autotruck.Id,
                CarNumber          = autotruck.CarNumber,
                SupplierId         = lmyb.SupplierId,
                SupplierName       = lmyb.SupplierName,
                InFactoryPlace     = CommonAppConfig.GetInstance().AppIdentifier,
                MineId             = lmyb.MineId,
                MineName           = lmyb.MineName,
                TransportCompanyId = lmyb.TransportCompanyId,
                FuelKindId         = lmyb.FuelKindId,
                FuelKindName       = lmyb.FuelKindName,
                TicketWeight       = lmybDetail.TicketWeight,
                InFactoryTime      = inFactoryTime,
                IsFinish           = 0,
                IsUse         = 1,
                SamplingType  = eSamplingType.机械采样.ToString(),
                InFactoryType = lmyb.InFactoryType,
                StepName      = eTruckInFactoryStep.入厂.ToString(),
                Remark        = "根据来煤预报自动生成",
            };

            // 生成批次以及采制化三级编码数据
            CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport, lmyb);

            if (inFactoryBatch != null)
            {
                if (SelfDber.Insert(transport) > 0)
                {
                    // 插入未完成运输记录
                    return(SelfDber.Insert(new CmcsUnFinishTransport
                    {
                        TransportId = transport.Id,
                        CarType = eCarType.入场煤.ToString(),
                        AutotruckId = autotruck.Id,
                        PrevPlace = CommonAppConfig.GetInstance().AppIdentifier,
                    }) > 0);
                }
            }

            return(false);
        }
        /// <summary>
        /// 打印磅单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiPrint_Click(object sender, EventArgs e)
        {
            GridRow gridRow = superGridControl2_BuyFuel.PrimaryGrid.ActiveRow as GridRow;

            if (gridRow == null)
            {
                return;
            }
            View_BuyFuelTransport entity  = gridRow.DataItem as View_BuyFuelTransport;
            CmcsBuyFuelTransport  entity2 = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(entity.Id);
            FrmPrintWeb           frm     = new FrmPrintWeb(entity2);

            frm.ShowDialog();
        }
Beispiel #10
0
        /// <summary>
        /// 保存入厂煤运输记录
        /// </summary>
        /// <param name="transportId"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        public bool SaveBuyFuelTransport(string transportId, DateTime dt)
        {
            CmcsBuyFuelTransport transport = SelfDber.Get <CmcsBuyFuelTransport>(transportId);

            if (transport == null)
            {
                return(false);
            }

            transport.StepName      = eTruckInFactoryStep.入厂.ToString();
            transport.InFactoryTime = dt;

            return(SelfDber.Update(transport) > 0);
        }
Beispiel #11
0
        /// <summary>
        ///  生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck"></param>
        /// <param name="supplier"></param>
        /// <param name="mine"></param>
        /// <param name="transportCompany"></param>
        /// <param name="fuelKind"></param>
        /// <param name="ticketWeight"></param>
        /// <param name="inFactoryTime"></param>
        /// <param name="remark"></param>
        /// <param name="samplingType"></param>
        /// <param name="lmyb"></param>
        /// <param name="inFactoryType"></param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, decimal ticketWeight, DateTime inFactoryTime, string remark, string samplingType, CmcsLMYB lmyb, string inFactoryType)
        {
            eTransportType TransportType;

            Enum.TryParse(inFactoryType, out TransportType);
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber       = carTransportDAO.CreateNewTransportSerialNumber(TransportType, inFactoryTime),
                AutotruckId        = autotruck.Id,
                CarNumber          = autotruck.CarNumber,
                SupplierId         = supplier.Id,
                SupplierName       = supplier.Name,
                InFactoryPlace     = CommonAppConfig.GetInstance().AppIdentifier,
                MineId             = mine.Id,
                MineName           = mine.Name,
                TransportCompanyId = (transportCompany == null ? null : transportCompany.Id),
                FuelKindId         = fuelKind.Id,
                FuelKindName       = fuelKind.FuelName,
                TicketWeight       = ticketWeight,
                InFactoryTime      = inFactoryTime,
                IsFinish           = 0,
                IsUse         = 1,
                SamplingType  = samplingType,
                InFactoryType = inFactoryType.ToString(),
                StepName      = eTruckInFactoryStep.入厂.ToString(),
                Remark        = remark,
                LMYBId        = lmyb != null ? lmyb.Id : "",
                YbNum         = lmyb != null ? lmyb.YbNum : ""
            };

            // 生成批次以及采制化三级编码数据
            CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport, lmyb);

            if (inFactoryBatch != null)
            {
                if (SelfDber.Insert(transport) > 0)
                {
                    // 插入未完成运输记录
                    return(SelfDber.Insert(new CmcsUnFinishTransport
                    {
                        TransportId = transport.Id,
                        CarType = inFactoryType.ToString(),
                        AutotruckId = autotruck.Id,
                        PrevPlace = CommonAppConfig.GetInstance().AppIdentifier,
                    }) > 0);
                }
            }

            return(false);
        }
Beispiel #12
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CmcsBuyFuelTransport transport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(this.transportId);

            if (transport != null)
            {
                transport.KgWeight = Convert.ToDecimal(txtKGWeight.Text);
                transport.KsWeight = Convert.ToDecimal(txtKSWeight.Text);
                commonDAO.SelfDber.Update <CmcsBuyFuelTransport>(transport);

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Beispiel #13
0
        public FrmCarDeduction_Confirm(string transportId)
        {
            InitializeComponent();

            this.transportId = transportId;
            CmcsBuyFuelTransport transport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(this.transportId);

            if (transport != null)
            {
                txtCarNum.Text   = transport.CarNumber;
                txtKGWeight.Text = transport.KgWeight.ToString("f2");
                txtKSWeight.Text = transport.KsWeight.ToString("f2");
            }
        }
        public int SyncTransport(Action <string, eOutputType> output)
        {
            int res = 0;
            IList <TransportOld> list = DcDbers.GetInstance().TruckWeight_Dber.Entities <TransportOld>("where IsToServer=0 and SuttleWeight>0");

            foreach (TransportOld item in list)
            {
                CmcsBuyFuelTransport entity = CommonDAO.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(item.Id);
                if (entity == null)
                {
                    entity                     = new CmcsBuyFuelTransport();
                    entity.Id                  = item.Id;
                    entity.CreateDate          = item.CreateDate;
                    entity.OperDate            = item.OperDate;
                    entity.OperUser            = item.OperUser;
                    entity.CreateUser          = item.CreateUser;
                    entity.InFactoryTime       = item.InFactoryTime;
                    entity.GrossPlace          = item.GrossPlace;
                    entity.GrossTime           = item.GrossTime;
                    entity.GrossWeight         = item.GrossWeight;
                    entity.TarePlace           = item.TarePlace;
                    entity.TareTime            = item.TareTime;
                    entity.TareWeight          = item.TareWeight;
                    entity.SuttleWeight        = item.SuttleWeight;
                    entity.KsWeight            = item.KsWeight;
                    entity.KgWeight            = item.KgWeight;
                    entity.AutoKsWeight        = item.AutoKsWeight;
                    entity.CheckWeight         = item.CheckWeight;
                    entity.ProfitAndLossWeight = item.ProfitAndLossWeight;
                    entity.OutFactoryTime      = item.OutFactoryTime;
                    entity.MineName            = item.MineName;
                    entity.AutotruckId         = item.AutotruckId;
                    entity.CarNumber           = item.CarNumber;
                    entity.TicketWeight        = item.TicketWeight;
                    entity.FuelKindId          = item.FuelKindId;
                    entity.FuelKindName        = item.FuelKindName;
                    entity.IsUse               = item.IsUse;
                    entity.IsFinish            = item.IsFinish;
                    entity.StepName            = item.StepName;
                    entity.InFactoryBatchId    = item.InFactoryBatchId;
                    entity.SerialNumber        = item.SerialNumber;
                    res            += CommonDAO.GetInstance().SelfDber.Insert(entity);
                    item.IsToServer = 1;
                    DcDbers.GetInstance().TruckWeight_Dber.Update(item);
                }
            }
            output(string.Format("同步运输记录 {0} 条(第三方 > 集中管控)", res), eOutputType.Normal);
            return(res);
        }
Beispiel #15
0
        /// <summary>
        /// 生成运输记录流水号
        /// </summary>
        /// <param name="carType">车类型</param>
        /// <param name="dt"></param>
        /// <returns></returns>
        public string CreateNewTransportSerialNumber(eCarType carType, DateTime dt)
        {
            string prefix = "Null";

            if (carType == eCarType.入厂煤)
            {
                prefix = "RCM";

                CmcsBuyFuelTransport entity = SelfDber.Entity <CmcsBuyFuelTransport>("where to_char(CreateDate,'yyyymmdd')=to_char(:CreateDate,'yyyymmdd') and SerialNumber like :Prefix || '%' order by InFactoryTime desc", new { CreateDate = dt, Prefix = prefix });
                if (entity == null)
                {
                    return(prefix + dt.ToString("yyMMdd") + "001");
                }
                else
                {
                    return(prefix + dt.ToString("yyMMdd") + (Convert.ToInt16(entity.SerialNumber.Replace(prefix + dt.ToString("yyMMdd"), "")) + 1).ToString().PadLeft(3, '0'));
                }
            }
            else if (carType == eCarType.销售煤)
            {
                prefix = "XSM";

                CmcsSaleFuelTransport entity = SelfDber.Entity <CmcsSaleFuelTransport>("where to_char(CreateDate,'yyyymmdd')=to_char(:CreateDate,'yyyymmdd') and SerialNumber like :Prefix || '%' order by InFactoryTime desc", new { CreateDate = dt, Prefix = prefix });
                if (entity == null)
                {
                    return(prefix + dt.ToString("yyMMdd") + "001");
                }
                else
                {
                    return(prefix + dt.ToString("yyMMdd") + (Convert.ToInt16(entity.SerialNumber.Replace(prefix + dt.ToString("yyMMdd"), "")) + 1).ToString().PadLeft(3, '0'));
                }
            }
            else if (carType == eCarType.其他物资)
            {
                prefix = "WZ";

                CmcsGoodsTransport entity = SelfDber.Entity <CmcsGoodsTransport>("where to_char(CreateDate,'yyyymmdd')=to_char(:CreateDate,'yyyymmdd') and SerialNumber like :Prefix || '%' order by InFactoryTime desc", new { CreateDate = dt, Prefix = prefix });
                if (entity == null)
                {
                    return(prefix + dt.ToString("yyMMdd") + "001");
                }
                else
                {
                    return(prefix + dt.ToString("yyMMdd") + (Convert.ToInt16(entity.SerialNumber.Replace(prefix + dt.ToString("yyMMdd"), "")) + 1).ToString().PadLeft(3, '0'));
                }
            }

            return(prefix + dt.ToString("yyMMdd") + DateTime.Now.Second.ToString().PadLeft(3, '0'));
        }
        /// <summary>
        /// 请求数据
        /// </summary>
        void RequestData()
        {
            string value = string.Empty, machineCode = string.Empty;
            List <HtmlDataItem> datas = new List <HtmlDataItem>();

            datas.Clear();

            machineCode = this.CurrentMachineCode;
            string[] machineCodes     = new string[] { GlobalVars.MachineCode_QC_Weighter_1, GlobalVars.MachineCode_QC_Weighter_2, GlobalVars.MachineCode_QC_Weighter_3, GlobalVars.MachineCode_QC_Weighter_4 };
            for (int i = 0; i < machineCodes.Length; i++)
            {
                int machineNumber = i + 1;
                machineCode = machineCodes[i];
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_系统", monitorCommon.ConvertBooleanToColor(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.系统.ToString())), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_IO控制器", monitorCommon.ConvertBooleanToColor(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.IO控制器_连接状态.ToString())), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_地磅仪表", monitorCommon.ConvertBooleanToColor(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.地磅仪表_连接状态.ToString())), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_LED屏", monitorCommon.ConvertBooleanToColor(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.LED屏1_连接状态.ToString())), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_读卡器1", monitorCommon.ConvertBooleanToColor(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.读卡器1_连接状态.ToString())), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_读卡器2", monitorCommon.ConvertBooleanToColor(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.读卡器2_连接状态.ToString())), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_仪表重量", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.地磅仪表_实时重量.ToString()) + " 吨", eHtmlDataItemType.svg_text));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_仪表重量", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.地磅仪表_稳定.ToString()).ToLower() == "1" ? ColorTranslator.ToHtml(EquipmentStatusColors.BeReady) : ColorTranslator.ToHtml(EquipmentStatusColors.Working), eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_当前车号", string.IsNullOrEmpty(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.当前车号.ToString())) ? "--" : commonDAO.GetSignalDataValue(machineCode, eSignalDataName.当前车号.ToString()), eHtmlDataItemType.svg_text));

                if (!string.IsNullOrWhiteSpace(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.当前运输记录Id.ToString())))
                {
                    CmcsBuyFuelTransport cmcsBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.当前运输记录Id.ToString()));
                    datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_毛重", cmcsBuyFuelTransport == null ? "0 吨" : cmcsBuyFuelTransport.GrossWeight + " 吨", eHtmlDataItemType.svg_text));
                    datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_皮重", cmcsBuyFuelTransport == null ? "0 吨" : cmcsBuyFuelTransport.TareWeight + " 吨", eHtmlDataItemType.svg_text));
                }
                else
                {
                    datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_毛重", "0 吨", eHtmlDataItemType.svg_text));
                    datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_皮重", "0 吨", eHtmlDataItemType.svg_text));
                }

                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_卡车", (!string.IsNullOrEmpty(commonDAO.GetSignalDataValue(machineCode, eSignalDataName.当前车号.ToString()))).ToString(), eHtmlDataItemType.svg_visible));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_地感1", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.地感1信号.ToString()).ToLower() == "1" ? ColorTranslator.ToHtml(EquipmentStatusColors.Working) : "#c0c0c0", eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_地感2", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.地感2信号.ToString()).ToLower() == "1" ? ColorTranslator.ToHtml(EquipmentStatusColors.Working) : "#c0c0c0", eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_对射1", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.对射1信号.ToString()).ToLower() == "1" ? ColorTranslator.ToHtml(EquipmentStatusColors.Working) : "#c0c0c0", eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_对射2", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.对射2信号.ToString()).ToLower() == "1" ? ColorTranslator.ToHtml(EquipmentStatusColors.Working) : "#c0c0c0", eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_对射3", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.对射3信号.ToString()).ToLower() == "1" ? ColorTranslator.ToHtml(EquipmentStatusColors.Working) : "#c0c0c0", eHtmlDataItemType.svg_color));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_道闸1", (commonDAO.GetSignalDataValue(machineCode, eSignalDataName.道闸1升杆.ToString()) == "0").ToString(), eHtmlDataItemType.svg_visible));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_道闸2", (commonDAO.GetSignalDataValue(machineCode, eSignalDataName.道闸2升杆.ToString()) == "0").ToString(), eHtmlDataItemType.svg_visible));
                datas.Add(new HtmlDataItem("#" + machineNumber + "汽车衡_卡车", commonDAO.GetSignalDataValue(machineCode, eSignalDataName.磅方向.ToString()), eHtmlDataItemType.svg_scare));
                // 添加更多...
            }
            // 发送到页面
            cefWebBrowser.Browser.GetMainFrame().ExecuteJavaScript("requestData(" + Newtonsoft.Json.JsonConvert.SerializeObject(datas) + ");", "", 0);
        }
Beispiel #17
0
        private void superGridControl1_DataBindingComplete(object sender, GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow item in e.GridPanel.Rows)
            {
                try
                {
                    CmcsBuyFuelTransport cmcsBuyFuelTransport = item.DataItem as CmcsBuyFuelTransport;

                    item.Cells["cellPASSWEIGHT"].Value = cmcsBuyFuelTransport.PASSWEIGHT.ToString("f2");
                }
                catch (Exception)
                {
                }
            }
        }
Beispiel #18
0
        /// <summary>
        /// 保存入厂煤运输记录
        /// </summary>
        /// <param name="transportId"></param>
        /// <param name="place"></param>
        /// <returns></returns>
        public bool SaveBuyFuelTransport(string transportId, DateTime dt, string place)
        {
            CmcsBuyFuelTransport transport = SelfDber.Get <CmcsBuyFuelTransport>(transportId);

            if (transport == null)
            {
                return(false);
            }

            transport.StepName     = eTruckInFactoryStep.采样.ToString();
            transport.SamplingTime = dt;
            transport.SamplePlace  = place;

            return(SelfDber.Update(transport) > 0);
        }
Beispiel #19
0
        /// <summary>
        /// 保存入厂煤运输记录
        /// </summary>
        /// <param name="transportId"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        public bool SaveBuyFuelTransport(string transportId, DateTime dt)
        {
            CmcsBuyFuelTransport transport = SelfDber.Get <CmcsBuyFuelTransport>(transportId);

            if (transport == null)
            {
                return(false);
            }
            transport.OutFactoryPlace = CommonAppConfig.GetInstance().AppIdentifier;
            transport.StepName        = eTruckInFactoryStep.出厂.ToString();
            transport.OutFactoryTime  = dt;
            transport.IsFinish        = 1;
            transport.IsSynch         = "0";

            return(SelfDber.Update(transport) > 0);
        }
Beispiel #20
0
        /// <summary>
        /// 选择回皮车辆
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSelectAutotruck_BuyFuel_Click(object sender, EventArgs e)
        {
            FrmUnFinishTransport_Select frm = new FrmUnFinishTransport_Select("where CarType='" + eCarType.入场煤.ToString() + "' order by CreateDate desc");

            if (frm.ShowDialog() == DialogResult.OK)
            {
                List <View_UnFinishTransport> list = CarTransportDAO.GetInstance().GetUnFinishTransportByCarNumber(frm.Output.CarNumber.Trim(), " order by CreateDate desc");
                if (list != null && list.Count > 0)
                {
                    this.CurrentBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(list[0].TransportId);
                }
                else
                {
                    this.CurrentBuyFuelTransport = null;
                }
            }
        }
Beispiel #21
0
 private void FrmSupplier_Oper_Load(object sender, EventArgs e)
 {
     this.MinimizeBox = false;
     if (!String.IsNullOrEmpty(id))
     {
         try
         {
             this.cmcsSupplier = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(this.id);
             makeImage(null, null);
         }
         catch (Exception ex)
         {
             MessageBoxEx.Show("打印失败,请联系系统管理员!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             this.Close();
         }
     }
 }
Beispiel #22
0
 public void Print(CmcsBuyFuelTransport buyfueltransport)
 {
     if (buyfueltransport == null)
     {
         return;
     }
     _BuyFuelTransport = buyfueltransport;
     try
     {
         this._PrintDocument.Print();
     }
     catch (Exception ex)
     {
         Log4Neter.Error("打印异常,请检查打印机!", ex);
     }
     _BuyFuelTransport = null;
 }
Beispiel #23
0
        /// <summary>
        /// 生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck">车</param>
        /// <param name="supplier">供煤单位</param>
        /// <param name="mine">矿点</param>
        /// <param name="transportCompany">运输单位</param>
        /// <param name="fuelKind">煤种</param>
        /// <param name="ticketWeight">矿发量</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <param name="remark">备注</param>
        /// <param name="place">地点</param>
        /// <param name="samplingType">采样方式</param>
        /// <param name="heavyweight">重车磅</param>
        /// <param name="samplingType">船号</param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, decimal ticketWeight, DateTime inFactoryTime, string remark, string place, string heavyweight, string shipnumber)
        {
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber         = carTransportDAO.CreateNewTransportSerialNumber(eCarType.入厂煤, inFactoryTime),
                AutotruckId          = autotruck.Id,
                CarNumber            = autotruck.CarNumber,
                SupplierId           = supplier.Id,
                SupplierName         = supplier.Name,
                MineId               = mine != null ? mine.Id:"",
                MineName             = mine != null ? mine.Name:"",
                TransportCompanyId   = transportCompany != null?transportCompany.Id:"",
                TransportCompanyName = transportCompany != null ? transportCompany.Name:"",
                FuelKindId           = fuelKind != null?fuelKind.Id:"",
                FuelKindName         = fuelKind != null ? fuelKind.Name:"",
                TicketWeight         = ticketWeight,
                InFactoryTime        = inFactoryTime,
                IsFinish             = 0,
                IsUse       = 1,
                StepName    = eTruckInFactoryStep.入厂.ToString(),
                Remark      = remark,
                HeavyWeight = heavyweight,
                ShipName    = shipnumber,
                Recorder    = GlobalVars.LoginUser.Name
            };

            // 生成批次以及采制化三级编码数据
            CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport);

            if (inFactoryBatch != null)
            {
                if (SelfDber.Insert(transport) > 0)
                {
                    // 插入未完成运输记录
                    return(SelfDber.Insert(new CmcsUnFinishTransport
                    {
                        TransportId = transport.Id,
                        CarType = eCarType.入厂煤.ToString(),
                        AutotruckId = autotruck.Id,
                        PrevPlace = place,
                    }) > 0);
                }
            }

            return(false);
        }
Beispiel #24
0
        void Search(string input)
        {
            List <View_UnFinishTransport> list = new List <View_UnFinishTransport>();

            if (!string.IsNullOrEmpty(input))
            {
                list = CarTransportDAO.GetInstance().GetUnFinishTransportByCarNumberAccurate(input.Trim(), " order by CreateDate desc");
                if (list != null && list.Count > 0)
                {
                    this.CurrentBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(list[0].TransportId);
                }
                else
                {
                    this.CurrentBuyFuelTransport = null;
                }
            }
        }
Beispiel #25
0
        private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow item in e.GridPanel.Rows)
            {
                try
                {
                    CmcsLMYBDetail entity = item.DataItem as CmcsLMYBDetail;
                    item.Cells["clmSupplierName"].Value = entity.TheLMYB.SupplierName;
                    item.Cells["clmMineName"].Value     = entity.TheLMYB.MineName;

                    item.Cells["clmStepName"].Value = "等待入场";
                    if (entity.IsFinish == "已完成")
                    {
                        item.Cells["operation"].Visible = false;
                    }
                    if (this.Type == "入场煤")
                    {
                        CmcsBuyFuelTransport transport = Dbers.GetInstance().SelfDber.Entity <CmcsBuyFuelTransport>("where LMYBDetailId=:LMYBDetailId order by CreateDate desc", new { LMYBDetailId = entity.Id });
                        if (transport != null)
                        {
                            item.Cells["clmInFactoryTime"].Value = transport.InFactoryTime.ToString("yyyy-MMM-dd");
                            item.Cells["clmStepName"].Value      = transport.StepName;
                        }
                    }
                    else
                    {
                        CmcsSaleFuelTransport transport = Dbers.GetInstance().SelfDber.Entity <CmcsSaleFuelTransport>("where LMYBDetailId=:LMYBDetailId order by CreateDate desc", new { LMYBDetailId = entity.Id });
                        if (transport != null)
                        {
                            item.Cells["clmInFactoryTime"].Value = transport.InFactoryTime.ToString("yyyy-MMM-dd");
                            item.Cells["clmStepName"].Value      = transport.StepName;
                        }
                    }

                    CmcsAutotruck autoTruck = Dbers.GetInstance().SelfDber.Entity <CmcsAutotruck>("where CarNumber=:CarNumber order by CreateDate desc", new { CarNumber = entity.CarNumber });
                    if (autoTruck != null)
                    {
                        item.Cells["clmDriver"].Value      = autoTruck.Driver;
                        item.Cells["clmPhoneNumber"].Value = autoTruck.CellPhoneNumber;
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Beispiel #26
0
        /// <summary>
        /// 保存入厂煤运输记录
        /// </summary>
        /// <param name="transportId"></param>
        /// <param name="weight">重量</param>
        /// <param name="place"></param>
        /// <returns></returns>
        public bool SaveBuyFuelTransport(string transportId, decimal weight, DateTime dt, string place)
        {
            CmcsBuyFuelTransport transport = SelfDber.Get <CmcsBuyFuelTransport>(transportId);

            if (transport == null)
            {
                return(false);
            }

            //根据当前流程节点名称判断
            if (transport.StepName != eTruckInFactoryStep.重车.ToString() && transport.StepName != eTruckInFactoryStep.采样.ToString())
            {
                transport.StepName    = eTruckInFactoryStep.重车.ToString();
                transport.GrossWeight = weight;
                transport.GrossPlace  = place;
                transport.GrossTime   = dt;
            }
            else if (transport.StepName == eTruckInFactoryStep.重车.ToString() || transport.StepName == eTruckInFactoryStep.采样.ToString())
            {
                transport.StepName   = eTruckInFactoryStep.轻车.ToString();
                transport.TareWeight = weight;
                transport.TarePlace  = place;
                transport.TareTime   = dt;

                //扣吨量
                transport.DeductWeight = GetDeductWeight(transport.Id);
                transport.SuttleWeight = transport.GrossWeight - transport.TareWeight - transport.DeductWeight;

                // 回皮即完结
                transport.IsFinish = 1;

                //流程结束时删除临时运输记录
                CmcsUnFinishTransport unFinishTransport = SelfDber.Entity <CmcsUnFinishTransport>("where TransportId=:TransportId", new { TransportId = transportId });
                if (unFinishTransport != null)
                {
                    SelfDber.Delete <CmcsUnFinishTransport>(unFinishTransport.Id);
                }
            }
            else
            {
                return(false);
            }

            return(SelfDber.Update(transport) > 0);
        }
Beispiel #27
0
        /// <summary>
        /// 生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck">车</param>
        /// <param name="supplier">供煤单位</param>
        /// <param name="mine">矿点</param>
        /// <param name="transportCompany">运输单位</param>
        /// <param name="fuelKind">煤种</param>
        /// <param name="ticketWeight">矿发量</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <param name="Mpph">全过程煤批编号</param>
        /// <param name="sampler">指定采样机编号</param>
        /// <param name="remark">备注</param>
        /// <param name="place">地点</param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, decimal ticketWeight, DateTime inFactoryTime, string Mpph, string sampler, string remark, string place)
        {
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber         = carTransportDAO.CreateNewTransportSerialNumber(eCarType.入厂煤, inFactoryTime),
                AutotruckId          = autotruck.Id,
                CarNumber            = autotruck.CarNumber,
                SupplierId           = supplier.Id,
                SupplierName         = supplier.Name,
                MineId               = mine.Id,
                MineName             = mine.Name,
                TransportCompanyId   = transportCompany.Id,
                TransportCompanyName = transportCompany.Name,
                FuelKindId           = fuelKind.Id,
                FuelKindName         = fuelKind.Name,
                TicketWeight         = ticketWeight,
                InFactoryTime        = inFactoryTime,
                IsFinish             = 0,
                IsUse          = 1,
                Mpph           = Mpph,
                SamplePlace    = sampler,
                StepName       = eTruckInFactoryStep.入厂.ToString(),
                HistoryTareAvg = GetHistoryTareAvg(autotruck.CarNumber),
                Remark         = remark
            };

            // 生成批次以及采制化三级编码数据
            //CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport);
            //if (inFactoryBatch != null)
            //{
            if (SelfDber.Insert(transport) > 0)
            {
                // 插入未完成运输记录
                return(SelfDber.Insert(new CmcsUnFinishTransport
                {
                    TransportId = transport.Id,
                    CarType = eCarType.入厂煤.ToString(),
                    AutotruckId = autotruck.Id,
                    PrevPlace = place,
                }) > 0);
            }
            //}

            return(false);
        }
Beispiel #28
0
        /// <summary>
        /// 入厂煤
        /// </summary>
        /// <param name="entity"></param>
        public void PrintBuyFuelTransport(CmcsBuyFuelTransport entity)
        {
            CmcsTransportTemp temp = new CmcsTransportTemp()
            {
                TareTime     = entity.TareTime,
                SupplierName = entity.MineName,
                CarNumber    = entity.CarNumber,
                FuelKindName = entity.FuelKindName,
                GrossWeight  = entity.GrossWeight,
                TareWeight   = entity.TareWeight,
                SuttleWeight = entity.SuttleWeight,
                DeductWeight = entity.DeductWeight,
                Remark       = entity.Remark,
                SerialNumber = entity.SerialNumber
            };

            Print(temp);
        }
Beispiel #29
0
        public void BindData()
        {
            ChangeColumn();
            List <CmcsBuyFuelTransport> list = Dbers.GetInstance().SelfDber.Entities <CmcsBuyFuelTransport>(this.SqlWhere + " order by CreateDate desc");

            if (ddlStatus.Text == eFlowStatus.出场.ToString() && list.Count > 0)
            {
                CmcsBuyFuelTransport total = new CmcsBuyFuelTransport();
                total.CarNumber   = "合计";
                total.GrossWeight = list.Sum(a => a.GrossWeight);
                total.TareWeight  = list.Sum(a => a.TareWeight);
                total.CheckWeight = list.Sum(a => a.CheckWeight);
                total.KgWeight    = list.Sum(a => a.KgWeight);
                total.KsWeight    = list.Sum(a => a.KsWeight);
                list.Insert(list.Count, total);
            }
            superGridControl1.PrimaryGrid.DataSource = list;
        }
Beispiel #30
0
 private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
 {
     foreach (GridRow gridRow in e.GridPanel.Rows)
     {
         CmcsBuyFuelTransport entity = gridRow.DataItem as CmcsBuyFuelTransport;
         if (entity == null)
         {
             return;
         }
         gridRow.Cells["clmKsWeight"].Value = entity.AutoKsWeight + entity.KsWeight;
         if (entity.MineName == "合计")
         {
             gridRow.Cells["clmFuelKind"].Visible  = false;
             gridRow.Cells["clmGrossTime"].Visible = false;
             gridRow.Cells["clmTareTime"].Visible  = false;
         }
     }
 }