Example #1
0
        public ActionResult ExportData(Lot_TransformedQuery query)
        {
            int    recordCount = 0;
            string xlsName     = string.Format("Transform_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss"));

            if (StringHelper.isNullOrEmpty(query.OrderBy))
            {
                query.OrderBy   = "CreateDate";
                query.OrderDesc = true;
            }
            if (CurrentUserInfo.Role == UserRoles.Fab || CurrentUserInfo.Role == UserRoles.FabAdmin)
            {
                query.Osat   = CurrentUserInfo.BUName;
                query.Status = (int)WaferStatus.WaitVendor;
            }
            IList <Lot_Transformed> list = service.GetAllLots(query, 0xf423f, 0, out recordCount);

            if (list != null && list.Count > 0)
            {
                foreach (Lot_Transformed lot in list)
                {
                    lot.StatusText = WaferHelper.waferStatusDes(lot.Status);
                }
            }
            string        nextUrl     = Exporthelper.GetExport <Lot_Transformed>("LOTS", list, "/Export/Excels/Transform/", "/Content/Exports/ExportTransform.xml", xlsName, 0, 0);
            ResponseTypes redirect    = ResponseTypes.Redirect;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
Example #2
0
        public IList <Lot_Transformed> GetAllLots(Lot_TransformedQuery lot, int pageSize, int pageIndex, out int recordCount)
        {
            Conditions      conditions      = GetCondition(lot);
            OrderExpression orderExpression = null;

            if (!StringHelper.isNullOrEmpty(lot.OrderBy))
            {
                orderExpression = new OrderExpression(lot.OrderBy, lot.OrderDesc);
            }

            IList <Lot_Transformed> list = this.dbGateway.getRecords(pageIndex, pageSize, conditions, orderExpression, null, Connector.AND, out recordCount);

            return(list);
        }
        public ActionResult Search(int pageSize, int pageIndex)
        {
            Lot_TransformedQuery query = TransformQueryUtility.GetLotTransformQuery(base.Request);

            if (StringHelper.isNullOrEmpty(query.OrderBy))
            {
                query.OrderBy   = "CreateDate";
                query.OrderDesc = true;
            }
            if (CurrentUserInfo.Role == UserRoles.Fab || CurrentUserInfo.Role == UserRoles.FabAdmin)
            {
                query.Osat = CurrentUserInfo.BUName;

                //query.Status=(int)WaferStatus.WaitVendor;
                //query.PeVendorState = (int)WaferStatus.WaitPEVendor;
            }
            int recordCount = 0;
            IList <Lot_Transformed> list = service.GetAllLots(query, pageSize, pageIndex, out recordCount);

            if (list != null && list.Count > 0)
            {
                DateTime dt = DateTime.Parse(DateTime.Now.ToLocalTime().ToShortDateString());
                foreach (Lot_Transformed lot in list)
                {
                    lot.StatusText = WaferHelper.waferStatusDes(lot.Status);
                    int          recordcount = 0;
                    IList <File> listFile    = FileSystemService.GetFilesBy(lot.ID, "", "", "", "", FileStates.NotSpecified, FileTypes.NotSpecifiled, "", false, 0xf423f, 0, out recordcount);
                    lot.FileCount     = recordcount;
                    lot.DiesposRemark = waferService.LoadCountByDispose(lot.ID, lot.Status);
                    lot.dayCount      = (dt - DateTime.Parse(lot.CompletionDate.ToShortDateString())).Days;
                }
            }
            var json = JsonConvert.SerializeObject(new
            {
                currentPage = pageIndex,
                totalPages  = PagerUtility.GetPageCount(recordCount, pageSize),
                rows        = list
            });

            base.Response.Write(json);
            return(null);
        }
Example #4
0
        public static Lot_TransformedQuery GetLotTransformQuery(HttpRequestBase request)
        {
            Lot_TransformedQuery lot = new Lot_TransformedQuery {
                SearchType     = request.QueryString["SearchType"],
                ProductName    = request.QueryString["ProductName"],
                WaferCode      = request.QueryString["WaferCode"],
                Osat           = request.QueryString["Osat"],
                LotId          = request.QueryString["LotId"],
                Status         = StringHelper.isNullOrEmpty(request.QueryString["Status"]) ? -1 : Convert.ToInt32(request.QueryString["Status"]),
                HoldReason     = request.QueryString["HoldReason"],
                WfCount        = StringHelper.isNullOrEmpty(request.QueryString["WfCount"]) ? -1 : Convert.ToInt32(request.QueryString["WfCount"]),
                Yield          = request.QueryString["Yield"],
                CompletionDate = request.QueryString["CompletionDate"],
                OrderBy        = request.QueryString["OrderBy"],
                OrderDesc      = StringHelper.isNullOrEmpty(request.QueryString["OrderDesc"]) ? false : Convert.ToBoolean(request.QueryString["OrderDesc"]),
                LastDays       = StringHelper.isNullOrEmpty(request.QueryString["LastDays"]) ? -1 : Convert.ToInt32(request.QueryString["LastDays"]),
                OutClose       = StringHelper.isNullOrEmpty(request.QueryString["OutClose"]) ? 0 : Convert.ToInt32(request.QueryString["OutClose"]),
                OperatorStatus = StringHelper.isNullOrEmpty(request.QueryString["OperatorStatus"]) ? -1 : Convert.ToInt32(request.QueryString["OperatorStatus"]),
            };

            return(lot);
        }
Example #5
0
        private Conditions GetCondition(Lot_TransformedQuery lot)
        {
            Conditions conditions = new Conditions();

            //if (!StringHelper.isNullOrEmpty(lot.SearchType)) {
            //    conditions.ConditionExpressions.Add(new Condition("AutoJudeResult", Operator.EqualTo, lot.SearchType));
            //}
            if (!StringHelper.isNullOrEmpty(lot.ProductName))
            {
                conditions.ConditionExpressions.Add(new Condition("ProductName", Operator.Like, lot.ProductName));
            }
            if (!StringHelper.isNullOrEmpty(lot.WaferCode))
            {
                conditions.ConditionExpressions.Add(new Condition("WaferCode", Operator.Like, lot.WaferCode));
            }
            if (!StringHelper.isNullOrEmpty(lot.Osat))
            {
                conditions.ConditionExpressions.Add(new Condition("Vendor", Operator.EqualTo, lot.Osat));
            }

            if (!StringHelper.isNullOrEmpty(lot.LotId))
            {
                conditions.ConditionExpressions.Add(new Condition("LotId", Operator.Like, lot.LotId));
            }
            //if (lot.Status>0 && lot.OutClose<=0)
            //{
            //    conditions.ConditionExpressions.Add(new Condition("Status", Operator.EqualTo, lot.Status));
            //}
            if (lot.OutClose > 0)
            {
                if (lot.Status > 0)
                {
                    if (lot.PeVendorState > 0)
                    {
                        conditions.ConditionExpressions.Add(new Condition("Status", Operator.Between, lot.Status, lot.PeVendorState));
                    }
                    else
                    {
                        conditions.ConditionExpressions.Add(new Condition("Status", Operator.EqualTo, lot.Status));
                    }
                }
                else
                {
                    conditions.ConditionExpressions.Add(new Condition("Status", Operator.LessThan, (int)WaferStatus.Close));
                }
            }
            else
            {
                if (lot.Status > 0)
                {
                    if (lot.PeVendorState > 0)
                    {
                        conditions.ConditionExpressions.Add(new Condition("Status", Operator.Between, lot.Status, lot.PeVendorState));
                    }
                    else
                    {
                        conditions.ConditionExpressions.Add(new Condition("Status", Operator.EqualTo, lot.Status));
                    }
                }
            }
            if (!StringHelper.isNullOrEmpty(lot.HoldReason))
            {
                conditions.ConditionExpressions.Add(new Condition("HoldReason", Operator.Like, lot.HoldReason));
            }
            if (lot.WfCount > 0)
            {
                conditions.ConditionExpressions.Add(new Condition("WfCount", Operator.EqualTo, lot.WfCount));
            }
            if (!StringHelper.isNullOrEmpty(lot.Yield))
            {
                conditions.ConditionExpressions.Add(new Condition("Yield", Operator.EqualTo, lot.Yield));
            }
            if (!StringHelper.isNullOrEmpty(lot.CompletionDate))
            {
                string[] dateArray = lot.CompletionDate.Split('-');
                conditions.ConditionExpressions.Add(new Condition("CompletionDate", Operator.Between, dateArray[0], dateArray[1] + " 23:59:59"));
            }
            if (!StringHelper.isNullOrEmpty(lot.CreateDate))
            {
                string[] dateArray = lot.CreateDate.Split('-');
                conditions.ConditionExpressions.Add(new Condition("CreateDate", Operator.Between, dateArray[0], dateArray[1] + " 23:59:59"));
            }
            if (lot.LastDays > 0)
            {
                var dt = DateTime.Now.ToLocalTime();
                if (lot.LastDays == 1)
                {
                    conditions.ConditionExpressions.Add(new Condition("CompletionDate", Operator.Between, dt.AddHours(-24), dt));
                }
                else
                {
                    string str_startTime = dt.AddDays(-2).ToShortDateString();
                    conditions.ConditionExpressions.Add(new Condition("CompletionDate", Operator.Between, str_startTime, dt.ToShortDateString()));
                }
            }
            conditions.ConditionExpressions.Add(new Condition("RecordType", Operator.EqualTo, "Record"));
            conditions.Connector = Connector.AND;
            return(conditions);
        }
 public IList <Lot_Transformed> GetAllLots(Lot_TransformedQuery lot, int pageSize, int PageIndex, out int recordCount)
 {
     return(this.way.GetAllLots(lot, pageSize, PageIndex, out recordCount));
 }