Ejemplo n.º 1
0
        /// <summary>
        /// 获取有作业的设备信息
        /// </summary>
        /// <returns></returns>
        public async Task <JsonResult> GetDeviceTaskLst()
        {
            List <DeviceTaskDetail> detailLst = new List <DeviceTaskDetail>();

            List <Device> hasTask = await new CWDevice().FindListAsync(dv => dv.TaskID != 0);
            CWTask        cwtask  = new CWTask();

            foreach (Device dev in hasTask)
            {
                ImplementTask itask = await cwtask.FindAsync(dev.TaskID);

                if (itask != null)
                {
                    string           desp   = dev.Warehouse.ToString() + dev.DeviceCode.ToString();
                    string           type   = PlusCvt.ConvertTaskType(itask.Type);
                    string           status = PlusCvt.ConvertTaskStatus(itask.Status, itask.SendStatusDetail);
                    DeviceTaskDetail detail = new DeviceTaskDetail
                    {
                        DevDescp = desp,
                        TaskType = type,
                        Status   = status,
                        Proof    = itask.ICCardCode
                    };
                    detailLst.Add(detail);
                }
            }

            return(Json(detailLst, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 推送执行作业信息
 /// </summary>
 /// <param name="itask"></param>
 private void FileWatch_IMPTaskWatchEvent(int type, ImplementTask itask)
 {
     #region 给页面显示处理
     string           desp   = itask.Warehouse.ToString() + itask.DeviceCode.ToString();
     string           ctype  = PlusCvt.ConvertTaskType(itask.Type);
     string           status = PlusCvt.ConvertTaskStatus(itask.Status, itask.SendStatusDetail);
     DeviceTaskDetail detail = new DeviceTaskDetail
     {
         DevDescp = desp,
         TaskType = ctype,
         Status   = status,
         Proof    = itask.ICCardCode
     };
     //作业要删除时
     if (type == 3)
     {
         detail.TaskType = "";
         detail.Status   = "";
         detail.Proof    = "";
     }
     //给界面用
     Clients.All.feedbackImpTask(detail);
     #endregion
 }