コード例 #1
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
 public ActionResult DeliveryNotifyDetailList(int? id)
 {
     List<AscmDeliveryNotifyDetail> list = null;
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         if (id.HasValue)
         {
             list = AscmDeliveryNotifyDetailService.GetInstance().GetList(id.Value);
             foreach (AscmDeliveryNotifyDetail ascmDeliveryNotifyDetail in list)
             {
                 jsonDataGridResult.rows.Add(ascmDeliveryNotifyDetail.GetOwner());
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }
コード例 #2
0
ファイル: VehicleController.cs プロジェクト: gofixiao/Midea
        public ActionResult EmployeeCarSwipeLogList(int? page, int? rows, string sort, string order, string queryWord, int? doorId,
            string direction, string plateNumber, string employeeName, string queryStartTime, string queryEndTime)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = string.Empty;
                if (doorId.HasValue)
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "doorId=" + doorId);
                if (!string.IsNullOrEmpty(direction))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "direction='" + direction + "'");
                if (!string.IsNullOrEmpty(plateNumber))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "plateNumber like '%" + plateNumber.Trim() + "%'");
                if (!string.IsNullOrEmpty(employeeName))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "employeeName like '%" + employeeName.Trim() + "%'");
                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(queryStartTime) && DateTime.TryParse(queryStartTime, out dtStartCreateTime))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'");
                if (!string.IsNullOrEmpty(queryEndTime) && DateTime.TryParse(queryEndTime, out dtEndCreateTime))
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'");

                List<AscmEmpCarSwipeLog> list = AscmEmpCarSwipeLogService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                    list.ForEach(P => jsonDataGridResult.rows.Add(P));

                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #3
0
ファイル: LogisticsController.cs プロジェクト: gofixiao/Midea
        public ActionResult NotFinalDiscreteJobsList(int? page, int? rows, string sort, string order, string queryWord, string queryStartDate, string queryEndDate, string queryDocnumber, string queryStatus)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDiscreteJobs> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();

            try
            {
                string hql = "select new AscmWipRequirementOperations(b.wipEntityId) from AscmGetMaterialTask a, AscmWipRequirementOperations b, AscmWipEntities c";

                if (string.IsNullOrEmpty(queryStartDate) && string.IsNullOrEmpty(queryEndDate))
                    throw new Exception("起止作业日期不能为空!");

                string where = "", whereQueryWord = "", whereWipEntity = "";

                whereQueryWord = "a.id = b.taskId";
                where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);

                whereQueryWord = "b.wipEntityId = c.wipEntityId";
                where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);

                if (!string.IsNullOrEmpty(queryStatus))
                {
                    whereQueryWord = "a.status = '" + queryStatus + "'";
                    where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);
                }
                else
                {
                    whereQueryWord = "a.status != 'FINISH'";
                    where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryStartDate))
                {
                    string startDate = Convert.ToDateTime(queryStartDate).ToString("yyyy-MM-dd") + " 00:00";
                    whereQueryWord = "a.dateReleased >= '" + startDate + "'";
                    where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryEndDate))
                {
                    string endDate = Convert.ToDateTime(queryEndDate).ToString("yyyy-MM-dd") + " 00:00";
                    whereQueryWord = "a.dateReleased <= '" + endDate + "'";
                    where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryDocnumber))
                {
                    whereQueryWord = "c.name like '" + queryDocnumber + "%'";
                    where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(where))
                    hql += " where " + where;

                IList<AscmWipRequirementOperations> ilist = YnDaoHelper.GetInstance().nHibernateHelper.Find<AscmWipRequirementOperations>(hql);
                if (ilist != null && ilist.Count > 0)
                {
                    var wipEntityId = ilist.Select(P => P.wipEntityId).Distinct();
                    if (wipEntityId != null)
                    {
                        string wipEntityIds = string.Empty;
                        foreach (int item in wipEntityId)
                        {
                            if (!string.IsNullOrEmpty(wipEntityIds))
                                wipEntityIds += ",";
                            wipEntityIds += item;
                        }

                        whereQueryWord = AscmCommonHelperService.GetInstance().IsJudgeListCount(wipEntityIds, "wipEntityId");
                        whereWipEntity = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereWipEntity, whereQueryWord);
                    }

                    if (!string.IsNullOrEmpty(queryDocnumber))
                    {
                        whereQueryWord = "jobId like '" + queryDocnumber + "%'";
                        whereWipEntity = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereWipEntity, whereQueryWord);
                    }
                }

                if (!string.IsNullOrEmpty(whereWipEntity))
                {
                    list = AscmDiscreteJobsService.GetInstance().GetList(ynPage, "", "", "", whereWipEntity);
                    if (list != null && list.Count > 0)
                    {
                        foreach (AscmDiscreteJobs ascmDiscreteJobs in list)
                        {
                            jsonDataGridResult.rows.Add(ascmDiscreteJobs);
                        }
                    }
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
                jsonDataGridResult.result = true;
            }
            catch (Exception ex)
            {
                jsonDataGridResult.result = false;
                jsonDataGridResult.message = ex.Message;
            }

            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #4
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult SupplierAscxList(int? id, int? page, int? rows, string sort, string order, string q)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmSupplier> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                list = AscmSupplierService.GetInstance().GetList(ynPage, "", "", q,null);
                foreach (AscmSupplier ascmSupplier in list)
                {
                    jsonDataGridResult.rows.Add(ascmSupplier.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #5
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult MaterialMonitorList(int? page, int? rows, string sort, string order, string queryWord,
            int? supplierId, string warehouse, string startCreateTime, string endCreateTime, string status, int? employeeBuyer)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryOrderBatch> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereEmployeeBuyer = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";

                if (supplierId.HasValue)
                    whereSupplier = "supplierId=" + supplierId.Value;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                //if (!string.IsNullOrEmpty(status))
                whereStatus = "status = '" + MideaAscm.Dal.FromErp.Entities.AscmDeliveryOrderMain.StatusDefine.open + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(startCreateTime) && DateTime.TryParse(startCreateTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endCreateTime) && DateTime.TryParse(endCreateTime, out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                if (employeeBuyer.HasValue)
                    whereEmployeeBuyer = "id in(select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where buyerId=" + employeeBuyer + ")))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);

                list = AscmDeliveryOrderBatchService.GetInstance().GetMonitorList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    foreach (AscmDeliveryOrderBatch ascmDeliveryOrderBatch in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDeliveryOrderBatch.GetOwner());
                    }
                    jsonDataGridResult.total = ynPage.GetRecordCount();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #6
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult DeliveryOrderMainList(int? page, int? rows, string sort, string order, string queryWord,
            string supplier, string warehouse, string startDeliveryTime, string endDeliveryTime, string status)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryOrderMain> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse="";
                string whereStartDeliveryTime = "", whereEndDeliveryTime = "", whereStatus = "";

                if (!string.IsNullOrEmpty(supplier))
                    whereSupplier = "supplierId=" + supplier;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                DateTime dtStartDeliveryTime, dtEndDeliveryTime;
                if (!string.IsNullOrEmpty(startDeliveryTime) && DateTime.TryParse(startDeliveryTime, out dtStartDeliveryTime))
                    whereStartDeliveryTime = "deliveryTime>='" + dtStartDeliveryTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endDeliveryTime) && DateTime.TryParse(endDeliveryTime, out dtEndDeliveryTime))
                    whereEndDeliveryTime = "deliveryTime<'" + dtEndDeliveryTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartDeliveryTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndDeliveryTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);

                list = AscmDeliveryOrderMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmDeliveryOrderMain ascmDeliveryOrderMain in list)
                {
                    jsonDataGridResult.rows.Add(ascmDeliveryOrderMain.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #7
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult LoadJobLog(int? page, int? rows, string sort, string order, string jobName, string queryWord)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmJobLog> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                if (jobName != null && jobName.Trim() != "")
                {
                    list = AscmJobLogService.GetInstance().GetList(ynPage, sort, order, jobName, queryWord);
                    if (list != null)
                    {
                        foreach (AscmJobLog ascmJobLog in list)
                        {
                            jsonDataGridResult.rows.Add(ascmJobLog);
                        }
                        jsonDataGridResult.total = ynPage.GetRecordCount();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #8
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult EmployeeAscxList(int? id,int? page, int? rows, string sort, string order, string q)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmEmployee> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "";
                if (string.IsNullOrEmpty(q))
                {
                    if (id.HasValue)
                    {
                        whereOther = "id=" + id.Value;
                    }
                }
                list = AscmEmployeeService.GetInstance().GetList(ynPage, "", "", q,whereOther);
                foreach (AscmEmployee ascmEmployee in list)
                {
                    jsonDataGridResult.rows.Add(ascmEmployee.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #9
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult MaterialQueryList(int? page, int? rows, string sort, string order, string queryWord, string startInventoryItemId, string endInventoryItemId)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "";

                #region 物料编码
                string whereStartInventoryItemId = "", whereEndInventoryItemId = "";
                if (startInventoryItemId != null && startInventoryItemId != "")
                {
                    whereStartInventoryItemId = " docNumber='" + startInventoryItemId.Trim() + "')";
                }
                if (endInventoryItemId != null && endInventoryItemId != "")
                {
                    if (startInventoryItemId != null && startInventoryItemId != "")
                    {
                        whereStartInventoryItemId = " docNumber>='" + startInventoryItemId.Trim() + "' and docNumber<='" + endInventoryItemId.Trim() + "')";
                    }
                    else
                    {
                        whereEndInventoryItemId = " docNumber<='" + endInventoryItemId.Trim() + "')";
                    }
                }
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartInventoryItemId);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndInventoryItemId);
                #endregion

                List<AscmMaterialItem> list = AscmMaterialItemService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmMaterialItem ascmMaterialItem in list)
                {
                    jsonDataGridResult.rows.Add(ascmMaterialItem.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #10
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult MaterialList(int? page, int? rows, string sort, string order, string queryWord, string categoryCode)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereCategoryCode = "";
                //根据物料大类筛选,‘0000’为通用
                if (categoryCode != null && categoryCode != "" && categoryCode != "0000")
                    whereCategoryCode = "substr(docNumber,1,4)='" + categoryCode + "'";
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereCategoryCode);

                List<AscmMaterialItem> list = AscmMaterialItemService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmMaterialItem ascmMaterialItem in list)
                {
                    jsonDataGridResult.rows.Add(ascmMaterialItem.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #11
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult MaterialAscxList(int? page, int? rows, string sort, string order, string q, string subInventory)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmMaterialItem> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "";
            //                if (!string.IsNullOrEmpty(subInventory))
            //                {
            //                    whereOther = string.Format(@" id in
            //						(select a.pk.materialId from AscmLocationMaterialLink a
            //							inner join AscmWarelocation b on b.id = a.pk.warelocationId and b.warehouseId='{0}') ", subInventory);
            //                }

                list = AscmMaterialItemService.GetInstance().GetList(ynPage, "", "", q, whereOther);
                foreach (AscmMaterialItem ascmMaterialItem in list)
                {
                    jsonDataGridResult.rows.Add(ascmMaterialItem.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #12
0
ファイル: LogisticsController.cs プロジェクト: gofixiao/Midea
        public ActionResult AllocateLogisticsTaskList(int? page, int? rows, string sort, string order, string queryWord, string queryStartDate, string queryEndDate, string queryStartJobDate, string queryEndJobDate, string queryStatus, string queryLine, string queryType, string queryWarehouse)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            List<AscmGetMaterialTask> list = null;

            string userName = string.Empty;
            if (User.Identity.IsAuthenticated)
            {
                userName = User.Identity.Name;
            }

            try
            {
                string userRole = AscmUserInfoService.GetInstance().GetUserRoleName(userName);
                string userLogisticsClass = AscmUserInfoService.GetInstance().GetUserLogisticsName(userName);

                string whereOther = "", whereQueryWord = "";
                if (userRole.IndexOf("物流班长") > -1 || userRole.IndexOf("物流组长") > -1)
                {
                    string whereOrQueryWord = "";
                    string ids_userId = AscmAllocateRuleService.GetInstance().GetLogisticsRankerName(userLogisticsClass, userName);
                    if (!string.IsNullOrEmpty(ids_userId))
                        whereQueryWord = AscmCommonHelperService.GetInstance().IsJudgeListCount(ids_userId, "rankerId");
                    whereOrQueryWord = YnBaseClass2.Helper.StringHelper.SqlWhereOrAdd(whereOrQueryWord, whereQueryWord);

                    whereQueryWord = "rankerId is null";
                    whereOrQueryWord = YnBaseClass2.Helper.StringHelper.SqlWhereOrAdd(whereOrQueryWord, whereQueryWord);

                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereOrQueryWord);
                }
                else if (userRole.IndexOf("排产员") > -1)
                {
                    whereQueryWord = "rankerId = '" + userName + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }
                else if (userRole.IndexOf("领料员") > -1)
                {
                    whereQueryWord = "workerId = '" + userName + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (string.IsNullOrEmpty(queryStartDate) && string.IsNullOrEmpty(queryEndDate) && string.IsNullOrEmpty(queryStartJobDate) && string.IsNullOrEmpty(queryEndJobDate))
                    throw new Exception("请选择生成日期或作业日期");

                if (!string.IsNullOrEmpty(queryStartDate) && !string.IsNullOrEmpty(queryEndDate))
                {
                    queryStartDate = queryStartDate + " 00:00:00";
                    queryEndDate = queryEndDate + " 23:59:59";
                    whereQueryWord = "createTime >= '" + queryStartDate + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                    whereQueryWord = "createTime <= '" + queryEndDate + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }
                else if (!string.IsNullOrEmpty(queryStartDate) && string.IsNullOrEmpty(queryEndDate))
                {
                    whereQueryWord = "createTime like '" + queryStartDate + "%'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }
                else if (string.IsNullOrEmpty(queryStartDate) && !string.IsNullOrEmpty(queryEndDate))
                {
                    whereQueryWord = "createTime like '" + queryEndDate + "%'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryStartJobDate) && !string.IsNullOrEmpty(queryEndJobDate))
                {
                    queryStartJobDate = queryStartJobDate + " 00:00:00";
                    queryEndJobDate = queryEndJobDate + " 23:59:59";
                    whereQueryWord = "dateReleased >= '" + queryStartJobDate + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                    whereQueryWord = "dateReleased <= '" + queryEndJobDate + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }
                else if (!string.IsNullOrEmpty(queryStartJobDate) && string.IsNullOrEmpty(queryEndJobDate))
                {
                    whereQueryWord = "dateReleased like '" + queryStartJobDate + "%'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }
                else if (string.IsNullOrEmpty(queryStartJobDate) && !string.IsNullOrEmpty(queryEndJobDate))
                {
                    whereQueryWord = "dateReleased like '" + queryEndJobDate + "%'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryStatus))
                {
                    whereQueryWord = "status = '" + queryStatus + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryLine))
                {
                    whereQueryWord = "productline like '" + queryLine.Trim() + "%'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryType))
                {
                    whereQueryWord = "IdentificationId =" + queryType;
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryWarehouse))
                {
                    whereQueryWord = "warehouserId = '" + queryWarehouse + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                list = AscmGetMaterialTaskService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                AscmGetMaterialTaskService.GetInstance().SetRanker(list);
                AscmGetMaterialTaskService.GetInstance().SetWorker(list);
                AscmGetMaterialTaskService.GetInstance().SetWarehousePlace(list);
                AscmGetMaterialTaskService.GetInstance().SumQuantity(list);
                list = list.OrderBy(e => e.statusInt).ToList<AscmGetMaterialTask>();
                if (list != null && list.Count > 0)
                {
                    foreach (AscmGetMaterialTask ascmGetMaterialTask in list)
                    {
                        jsonDataGridResult.rows.Add(ascmGetMaterialTask);
                    }
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
                jsonDataGridResult.result = true;
            }
            catch (Exception ex)
            {
                jsonDataGridResult.result = false;
                jsonDataGridResult.message = ex.Message;
            }

            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #13
0
ファイル: LogisticsController.cs プロジェクト: gofixiao/Midea
        // 作业自定义控件
        public ActionResult WipEntitiesAscxList(int? id, int? page, int? rows, string sort, string order, string q)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE);//pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1);//pageNumber;

            List<AscmDiscreteJobs> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                list = AscmDiscreteJobsService.GetInstance().GetList(ynPage, sort, order, q, null);
                if (list != null && list.Count > 0)
                {
                    foreach (AscmDiscreteJobs ascmDiscreteJobs in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDiscreteJobs);
                    }
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #14
0
ファイル: LogisticsController.cs プロジェクト: gofixiao/Midea
        // 某角色的所属用户自定义控件
        public ActionResult UserAscxList(int? id, int? page, int? rows, string sort, string order, string q, string queryRole)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE);//pageRows
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1);//pageNumber

            List<AscmUserInfo> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereQueryWord = "";
                if (!string.IsNullOrEmpty(queryRole))
                {
                    whereQueryWord = "p.name = '" + queryRole + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                list = AscmUserInfoService.GetInstance().GetList(null, "", "", q, whereOther);
                if (list != null && list.Count > 0)
                {
                    foreach (AscmUserInfo ascmUserInfo in list)
                    {
                        jsonDataGridResult.rows.Add(ascmUserInfo);
                    }
                    jsonDataGridResult.total = list.Count;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #15
0
ファイル: LogisticsController.cs プロジェクト: gofixiao/Midea
        public ActionResult SumGetMaterialQuantityList(int? page, int? rows, string sort, string order, string queryWord, string queryStartDate, string queryEndDate, string queryDocnumber)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            string userName = string.Empty;
            string userRole = string.Empty;
            if (User.Identity.IsAuthenticated)
            {
                userName = User.Identity.Name;
            }
            userRole = AscmUserInfoService.GetInstance().GetUserRoleName(userName);

            List<AscmMaterialItem> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string where = "", whereOther = "", whereQueryWord = "", whereMaterial = "", whereTask = "";

                if (string.IsNullOrEmpty(queryStartDate) && string.IsNullOrEmpty(queryEndDate))
                    throw new Exception("起止日期不能为空!");

                string startDate = string.Empty;
                if (!string.IsNullOrEmpty(queryStartDate))
                {
                    startDate = Convert.ToDateTime(queryStartDate).ToString("yyyy-MM-dd") + " 00:00:00";
                    whereQueryWord = "createTime >= '" + startDate + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                string endDate = string.Empty;
                if (!string.IsNullOrEmpty(queryEndDate))
                {
                    endDate = Convert.ToDateTime(queryEndDate).ToString("yyyy-MM-dd") + " 23:59:59";
                    whereQueryWord = "createTime <= '" + endDate + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (userRole.IndexOf("领料员") > -1)
                {
                    whereQueryWord = "workerId = '" + userName + "'";
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereQueryWord);
                }

                if (!string.IsNullOrEmpty(queryDocnumber))
                {
                    whereQueryWord = " docNumber like '" + queryDocnumber + "%'";
                    whereMaterial = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereMaterial, whereQueryWord);

                    List<AscmMaterialItem> listAscmMaterialItem = AscmMaterialItemService.GetInstance().GetList(null, "", "", "", whereMaterial);
                    if (listAscmMaterialItem == null || listAscmMaterialItem.Count == 0)
                        throw new Exception("物料编码不存在!");

                    if (listAscmMaterialItem != null && listAscmMaterialItem.Count > 0)
                    {
                        string idsMaterial = string.Empty;
                        foreach (AscmMaterialItem item in listAscmMaterialItem)
                        {
                            if (!string.IsNullOrEmpty(idsMaterial))
                                idsMaterial += ",";
                            idsMaterial += item.id;
                        }

                        if (!string.IsNullOrEmpty(idsMaterial))
                        {
                            whereQueryWord = AscmCommonHelperService.GetInstance().IsJudgeListCount(idsMaterial, "inventoryitemid");
                            whereTask = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereTask, whereQueryWord);
                        }
                    }
                }

                List<AscmGetMaterialTask> listAscmGetMaterialTask = AscmGetMaterialTaskService.GetInstance().GetList(null, "", "", "", whereOther);
                if (listAscmGetMaterialTask == null || listAscmGetMaterialTask.Count == 0)
                    throw new Exception("找不到指定日期的领料任务!");

                if (listAscmGetMaterialTask != null && listAscmGetMaterialTask.Count > 0)
                {
                    string ids = string.Empty;
                    foreach (AscmGetMaterialTask ascmGetMaterialTask in listAscmGetMaterialTask)
                    {
                        if (!string.IsNullOrEmpty(ids))
                            ids += ",";
                        ids += ascmGetMaterialTask.id;
                    }

                    if (!string.IsNullOrEmpty(ids))
                    {
                        whereQueryWord = AscmCommonHelperService.GetInstance().IsJudgeListCount(ids, "taskId");
                        whereTask = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereTask, whereQueryWord);
                    }
                }

                string sql = "select inventoryitemid, sum(requiredQuantity), sum(quantityIssued), sum(getMaterialQuantity), sum(requiredQuantity - quantityIssued) as quantityDifference, sum(requiredQuantity - getMaterialQuantity) as quantityGetMaterialDifference from ascm_wip_require_operat";

                if (!string.IsNullOrEmpty(whereTask))
                    sql += " where " + whereTask + " group by inventoryitemid";
                IList ilistOperations = YnDaoHelper.GetInstance().nHibernateHelper.ExecuteReader(sql);
                if (ilistOperations == null || ilistOperations.Count == 0)
                    throw new Exception("指定条件查询结果中未找到汇总编码");

                if (ilistOperations != null && ilistOperations.Count > 0)
                {
                    string idsOperations = string.Empty;
                    foreach (object[] obj in ilistOperations)
                    {
                        if (!string.IsNullOrEmpty(idsOperations))
                            idsOperations += ",";
                        idsOperations += obj[0].ToString();
                    }
                    whereQueryWord = AscmCommonHelperService.GetInstance().IsJudgeListCount(idsOperations,"id");
                    where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord);
                }

                list = AscmMaterialItemService.GetInstance().GetList(ynPage,"","","",where);

                if (list != null && list.Count > 0)
                {
                    foreach (AscmMaterialItem ascmMaterialItem in list)
                    {
                        foreach (object[] obj in ilistOperations)
                        {
                            int id = Convert.ToInt32(obj[0].ToString());
                            if (ascmMaterialItem.id == id)
                            {
                                ascmMaterialItem.requiredQuantity = Convert.ToDecimal(obj[1].ToString());
                                ascmMaterialItem.quantityIssued = Convert.ToDecimal(obj[2].ToString());
                                ascmMaterialItem.getMaterialQuantity = Convert.ToDecimal(obj[3].ToString());
                                ascmMaterialItem.quantityDifference = Convert.ToDecimal(obj[4].ToString());
                                ascmMaterialItem.quantityGetMaterialDifference = Convert.ToDecimal(obj[5].ToString());
                            }
                        }
                        jsonDataGridResult.rows.Add(ascmMaterialItem);
                    }
                }
                jsonDataGridResult.result = true;
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                jsonDataGridResult.message = ex.Message;
                jsonDataGridResult.result = false;
            }

            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #16
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
 public ActionResult SupplierMaterialIdsList(string ids)
 {
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         if (!string.IsNullOrEmpty(ids))
         {
             List<AscmMaterialItem> list = AscmMaterialItemService.GetInstance().GetList("from AscmMaterialItem where id in(" + ids + ")");
             if (list != null)
             {
                 foreach (AscmMaterialItem ascmMaterialItem in list)
                 {
                     jsonDataGridResult.rows.Add(ascmMaterialItem);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }
コード例 #17
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult SupplierMaterialList(int? page, int? rows, string sort, string order, int? supplierId, string queryWord, string startInventoryItemId, string endInventoryItemId)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                if (supplierId.HasValue)
                {
                    List<AscmSupplierMaterialLink> listAscmSupplierMaterialLink = AscmSupplierMaterialLinkService.GetInstance().GetList(supplierId.Value);
                    List<AscmMaterialItem> listAscmMaterialItem = null;
                    if (listAscmSupplierMaterialLink != null && listAscmSupplierMaterialLink.Count() > 0)
                    {
                        string materialIds = string.Empty;
                        foreach (AscmSupplierMaterialLink ascmSupplierMaterialLink in listAscmSupplierMaterialLink)
                        {
                            if (!string.IsNullOrEmpty(materialIds))
                                materialIds += ",";
                            materialIds += ascmSupplierMaterialLink.materialId;
                        }
                        if (!string.IsNullOrEmpty(materialIds))
                        {
                            string[] Ids = materialIds.Split(',');
                            int iCount = Ids.Length;
                            string sWhere = string.Empty;
                            if (iCount > 900)
                            {
                                string ids = string.Empty;
                                for (int i = 0; i < iCount; i++)
                                {
                                    if (!string.IsNullOrEmpty(ids))
                                        ids += ",";
                                    ids += Ids.ElementAt(i);
                                    if ((i + 1) % 900 == 0 || (i + 1) == iCount)
                                    {
                                        if (!string.IsNullOrEmpty(sWhere))
                                            sWhere += " or ";
                                        sWhere += "id in (" + ids + ")";
                                        ids = string.Empty;
                                    }
                                }
                            }
                            else
                                sWhere = "id in (" + materialIds + ")";

                            string whereStartInventoryItemId = string.Empty, whereEndInventoryItemId = string.Empty, sWhereId = string.Empty;
                            if (!string.IsNullOrEmpty(startInventoryItemId))
                            {
                                whereStartInventoryItemId = " docNumber='" + startInventoryItemId.Trim() + "'";
                            }
                            if (!string.IsNullOrEmpty(endInventoryItemId))
                            {
                                if (!string.IsNullOrEmpty(startInventoryItemId))
                                {
                                    whereStartInventoryItemId = " docNumber>='" + startInventoryItemId.Trim() + "' and docNumber<='" + endInventoryItemId.Trim() + "'";
                                }
                                else
                                {
                                    whereEndInventoryItemId = " docNumber<='" + endInventoryItemId.Trim() + "'";
                                }
                            }
                            sWhereId = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(sWhereId, whereStartInventoryItemId);
                            sWhereId = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(sWhereId, whereEndInventoryItemId);
                            if (!string.IsNullOrEmpty(sWhereId))
                                sWhere = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(sWhereId, sWhere);
                            listAscmMaterialItem = AscmMaterialItemService.GetInstance().GetList(ynPage, "docNumber", "", "", "", "", sWhere);
                            if (listAscmMaterialItem != null && listAscmMaterialItem.Count() > 0)
                            {
                                foreach (AscmMaterialItem ascmMaterialItem in listAscmMaterialItem)
                                {
                                    jsonDataGridResult.rows.Add(ascmMaterialItem);
                                }
                            }
                        }
                    }
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                //jsonDataGridResult.message = ex.Message;
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #18
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
 public ActionResult ProcedureArgumentList(string jobName, string jobAction, string procedureJson)
 {
     List<AscmProcedureArgument> list = null;
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         string _procedureName = "";
         if (!string.IsNullOrEmpty(procedureJson))
         {
             AscmProcedure ascmProcedure = JsonConvert.DeserializeObject<AscmProcedure>(procedureJson);
             if (ascmProcedure != null)
             {
                 _procedureName = ascmProcedure._procedureName;
                 list = AscmProcedureArgumentService.GetInstance().GetList(ascmProcedure.objectType, ascmProcedure.objectName, ascmProcedure.procedureName);
             }
         }
         if (list != null)
         {
             List<AscmJobArgument> listJobArgument = null;
             if (!string.IsNullOrEmpty(jobName) && !string.IsNullOrEmpty(_procedureName) &&
                 _procedureName.Equals(jobAction, StringComparison.CurrentCultureIgnoreCase))
             {
                 listJobArgument = AscmJobArgumentService.GetInstance().GetList(jobName);
             }
             foreach (AscmProcedureArgument ascmProcedureArgument in list)
             {
                 if (listJobArgument != null)
                 {
                     AscmJobArgument ascmJobArgument = listJobArgument.Find(P => P.argumentPosition == ascmProcedureArgument.position);
                     if (ascmJobArgument != null)
                         ascmProcedureArgument.value = ascmJobArgument.value;
                 }
                 jsonDataGridResult.rows.Add(ascmProcedureArgument);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }
コード例 #19
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult ErpUserInfoList(int? page, int? rows, string sort, string order, string queryWord)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmUserInfo> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string organizationId = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketOrganizationId();

                string where = " extExpandType='erp' and not exists (select 1 from Ascm_Ak_Web_User_Sec_Attr b where b.attributeCode='" + AscmAkWebUserSecAttrValues.AttributeCodeDefine.supplierUser + "' and b.webUserId=u.extExpandId) ";
                //where = " extExpandType='erp'";
                //where = " not exists (from AscmAkWebUserSecAttrValues b where b.id=a.extExpandId) ";
                //where = " not exists (from AscmAkWebUserSecAttrValues b where b.id=a.extExpandId) ";
                list = AscmUserInfoService.GetInstance().GetList( ynPage, sort, order, queryWord, where);
                foreach (AscmUserInfo ascmUserInfo in list)
                {
                    //ynUser.listYnDepartment = YnDepartmentService.GetInstance().GetListInUser(ynUser.userId);
                    //ynUser.listYnDepartmentPositionLink = YnDepartmentPositionLinkService.GetInstance().GetListInUser(ynUser.userId);
                    //ynUser.listYnRole = YnRoleService.GetInstance().GetListInUser(ynUser.userId);
                    jsonDataGridResult.rows.Add(ascmUserInfo.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #20
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
 public ActionResult ProcedureList(string q)
 {
     List<AscmProcedure> list = null;
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         list = AscmProcedureService.GetInstance().GetList(q);
         if (list != null)
         {
             foreach (AscmProcedure ascmProceduresView in list)
             {
                 jsonDataGridResult.rows.Add(ascmProceduresView);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }
コード例 #21
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult DeliveryOrderBatchAscxList1(int? page, int? rows, string sort, string order, string queryWord,
           string supplier, string warehouse, string startCreateTime, string endCreateTime, string status, string ascmStatus,
            string startConfirmDate, string endConfirmDate, string startNotifyDate, string endNotifyDate, string startMaterialDocNumber, string endMaterialDocNumber,
            string appointmentStartTime, string appointmentEndTime, string queryFilter, bool? isSupplierSelect, int? supplierDeliveryBatSumId, bool appointmentTimeFilter)
        {
            //isSupplierSelect是否供应商选择批单方式,如果是则不显示已生成的批单
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereAscmStatus = "";//whereBatSumMain = "",
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";

                if (!string.IsNullOrEmpty(supplier) && supplier != "null")
                    whereSupplier = "supplierId=" + supplier;
                if (!string.IsNullOrEmpty(warehouse) && warehouse != "null")
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(startCreateTime) && DateTime.TryParse(startCreateTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd HH:mm:00") + "'";
                if (!string.IsNullOrEmpty(endCreateTime) && DateTime.TryParse(endCreateTime, out dtEndCreateTime))
                    //whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                    whereEndCreateTime = "createTime<='" + dtEndCreateTime.ToString("yyyy-MM-dd HH:mm:00") + "'";

                if (!string.IsNullOrEmpty(ascmStatus))
                {
                    if (ascmStatus == "INSTORAGE")
                        if (ascmStatus == AscmDeliveryOrderBatch.AscmStatusDefine.inStorage)
                            whereAscmStatus = "ascmStatus='" + ascmStatus + "'";
                        else
                            whereAscmStatus = " ascmStatus is null or ascmStatus<>'" + AscmDeliveryOrderBatch.AscmStatusDefine.inStorage + "'";
                }

                #region 物料编码
                string whereStartMaterialId = "", whereEndMaterialId = "";
                if (startMaterialDocNumber != null && startMaterialDocNumber != "")
                {
                    whereStartMaterialId = "id in (select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where docNumber='" + startMaterialDocNumber.Trim() + "')))";
                }
                if (endMaterialDocNumber != null && endMaterialDocNumber != "")
                {
                    if (startMaterialDocNumber != null && startMaterialDocNumber != "")
                    {
                        whereStartMaterialId = "id in (select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId  in(select id from AscmMaterialItem where docNumber>='" + startMaterialDocNumber.Trim() + "' and docNumber<='" + endMaterialDocNumber.Trim() + "')))";
                    }
                    else
                    {
                        whereEndMaterialId = "id in (select batchId from AscmDeliveryOrderMain where id in(select mainId from AscmDeliveryOrderDetail where materialId in(select id from AscmMaterialItem where docNumber<='" + endMaterialDocNumber.Trim() + "')))";
                    }
                }
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartMaterialId);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndMaterialId);
                #endregion

                #region 确认时间
                string whereStartConfirmDate = "", whereEndConfirmDate = "";
                DateTime dtStartConfirmDate, dtEndConfirmDate;
                if (!string.IsNullOrEmpty(startConfirmDate) && DateTime.TryParse(startConfirmDate, out dtStartConfirmDate))
                    whereStartConfirmDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where confirmTime>='" + dtStartConfirmDate.ToString("yyyy-MM-dd 00:00:00") + "'))))";
                if (!string.IsNullOrEmpty(endConfirmDate) && DateTime.TryParse(endConfirmDate, out dtEndConfirmDate))
                    whereEndConfirmDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where confirmTime<'" + dtEndConfirmDate.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'))))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartConfirmDate);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndConfirmDate);
                #endregion

                #region 通知时间
                string whereStartNotifyDate = "", whereEndNotifyDate = "";
                DateTime dtStartNotifyDate, dtEndNotifyDate;
                if (!string.IsNullOrEmpty(startNotifyDate) && DateTime.TryParse(startNotifyDate, out dtStartNotifyDate))
                    whereStartNotifyDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where releasedTime>='" + dtStartNotifyDate.ToString("yyyy-MM-dd 00:00:00") + "'))))";
                if (!string.IsNullOrEmpty(endNotifyDate) && DateTime.TryParse(endNotifyDate, out dtEndNotifyDate))
                    whereEndNotifyDate = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where releasedTime<'" + dtEndNotifyDate.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'))))";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartNotifyDate);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndNotifyDate);
                #endregion

                #region 预约时间
                DateTime dtAppointmentStartTime, dtAppointmentEndTime;
                string _appointmentStartTime = appointmentStartTime;
                string _appointmentEndTime = appointmentEndTime;
                if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtAppointmentEndTime))
                {
                    _appointmentEndTime = dtAppointmentEndTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
                }
                AscmDeliBatSumMain ascmDeliBatSumMain = null;
                if (supplierDeliveryBatSumId.HasValue)
                {
                    ascmDeliBatSumMain = AscmDeliBatSumMainService.GetInstance().Get(supplierDeliveryBatSumId.Value);
                    //ascmDeliBatSumMain.appointmentStartTime = "2013-11-20 09:00";
                    //ascmDeliBatSumMain.appointmentEndTime = "2013-11-20 10:00";
                    DateTime dtSumMainStartTime, dtSumMainEndTime;
                    DateTime dtTmp;
                    if (DateTime.TryParse(ascmDeliBatSumMain.appointmentStartTime, out dtSumMainStartTime) && DateTime.TryParse(ascmDeliBatSumMain.appointmentEndTime, out dtSumMainEndTime))
                    {
                        if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtTmp))
                        {
                            if (dtTmp < dtSumMainStartTime)
                                _appointmentStartTime = dtSumMainStartTime.ToString("yyyy-MM-dd HH:mm");
                        }
                        if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtTmp))
                        {
                            if (dtTmp > dtSumMainEndTime)
                                _appointmentEndTime = dtSumMainEndTime.ToString("yyyy-MM-dd HH:mm");
                        }
                    }
                    //2013.11.28对相同司机合单进行判断
                    List<AscmDeliBatSumMain> listAscmDeliBatSumMain = AscmDeliBatSumMainService.GetInstance().GetList("from AscmDeliBatSumMain where id<>" + ascmDeliBatSumMain.id + " and driverId=" + ascmDeliBatSumMain.driverId + " and status='" + AscmDeliBatSumMain.StatusDefine.unConfirm + "'");
                    foreach (AscmDeliBatSumMain ascmDeliBatSumMain_Other in listAscmDeliBatSumMain)
                    {
                        DateTime dtSumMainStartTime_Other, dtSumMainEndTime_Other;
                        if (DateTime.TryParse(ascmDeliBatSumMain_Other.appointmentStartTime, out dtSumMainStartTime_Other) && DateTime.TryParse(ascmDeliBatSumMain_Other.appointmentEndTime, out dtSumMainEndTime_Other))
                        {
                            if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtTmp))
                            {
                                if (dtTmp < dtSumMainStartTime_Other)
                                    _appointmentStartTime = dtSumMainStartTime_Other.ToString("yyyy-MM-dd HH:mm");
                            }
                            if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtTmp))
                            {
                                if (dtTmp > dtSumMainEndTime_Other)
                                    _appointmentEndTime = dtSumMainEndTime_Other.ToString("yyyy-MM-dd HH:mm");
                            }
                        }
                    }
                    //5)	最晚到货时间早于当前时间的批单,该批单总是可以勾选入合单
                    if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtTmp))
                    {
                        if (dtTmp < DateTime.Now)
                        {
                            _appointmentStartTime = null;
                            _appointmentEndTime = null;
                        }
                    }
                }
                if (appointmentTimeFilter)
                {
                    string whereAppointment = "";
                    //if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtAppointmentStartTime))
                    //    whereAppointment = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereAppointment, "appointmentStartTime>='" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "'");
                    //if (!string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtAppointmentEndTime))
                    //    whereAppointment = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereAppointment, "appointmentEndTime<='" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "'");
                    if (!string.IsNullOrEmpty(_appointmentStartTime) && DateTime.TryParse(_appointmentStartTime, out dtAppointmentStartTime) &&
                       !string.IsNullOrEmpty(_appointmentEndTime) && DateTime.TryParse(_appointmentEndTime, out dtAppointmentEndTime))
                    {
                        whereAppointment = "((appointmentEndTime between '" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "' and '" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "') or ";
                        whereAppointment += "(appointmentStartTime between '" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "' and '" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "' ) or ";
                        whereAppointment += "('" + dtAppointmentStartTime.ToString("yyyy-MM-dd HH:mm") + "' between appointmentStartTime and appointmentEndTime ) or ";
                        whereAppointment += "('" + dtAppointmentEndTime.ToString("yyyy-MM-dd HH:mm") + "' between appointmentStartTime and appointmentEndTime ))";
                    }
                    if (whereAppointment != "")
                    {
                        whereAppointment = "(" + whereAppointment + ") or appointmentStartTime=appointmentEndTime or appointmentEndTime<'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "'";
                        whereAppointment = "id in(select batchId from AscmDeliveryOrderMain where id in (select mainId from AscmDeliveryOrderDetail where notifyDetailId in (select id from AscmDeliveryNotifyDetail where mainId in (select id from AscmDeliveryNotifyMain where " + whereAppointment + "))))";
                        whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAppointment);
                    }
                    //whereAscmStatus = " ascmStatus is null or ascmStatus<>'" + AscmDeliveryOrderBatch.AscmStatusDefine.inStorage + "'";
                    //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "ascmStatus<>'" + AscmDeliveryOrderBatch.AscmStatusDefine.inStorage + "'");
                    whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, "ascmStatus is null or ascmStatus=''");
                }

                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAppointmentEndTime);
                #endregion

                #region 已经完成批单不能显示
                if (isSupplierSelect.HasValue)
                {
                    //whereBatSumMain = " select * from AscmDeliBatSumMain where status in ('" + AscmDeliBatSumMain.StatusDefine.unConfirm + "','" + AscmDeliBatSumMain.StatusDefine.confirm + "')";
                    //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAscmStatus);
                }
                if (supplierDeliveryBatSumId.HasValue)
                {
                    if (string.IsNullOrEmpty(queryFilter))
                    {
                        //string whereBatSumMain = " id not in (select batchId from AscmDeliBatSumDetail where mainId in (select id from AscmDeliBatSumMain where driverId=" + ascmDeliBatSumMain.driverId + "))";
                        string whereBatSumMain = " id not in (select batchId from AscmDeliBatSumDetail)";
                        whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereBatSumMain);
                    }
                }
                #endregion

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                //whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereBatSumMain);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAscmStatus);

                List<AscmDeliveryOrderBatch> list = AscmDeliveryOrderBatchService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    AscmDeliveryOrderBatchService.GetInstance().SetDeliveryNotifyMain(list);
                    if (!string.IsNullOrEmpty(sort) && sort.ToLower() == "appointmentEndTime".ToLower())
                    {
                        list = list.OrderBy(p => p.appointmentEndTime).ToList();
                    }
                    else if (!string.IsNullOrEmpty(sort) && sort.ToLower() == "warehouseId".ToLower())
                    {
                        list = list.OrderBy(p => p.warehouseId).ToList();
                    }

                    foreach (AscmDeliveryOrderBatch ascmDeliveryOrderBatch in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDeliveryOrderBatch.GetOwner());
                    }
                    jsonDataGridResult.total = ynPage.GetRecordCount();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #22
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult ReadingHeadLogList(int? page, int? rows, string sort, string order, string queryWord, int? readingHeadId, string queryStartTime, string queryEndTime)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereReadingHead = "";
                string whereStartCreateTime = "", whereEndCreateTime = "";
                if (readingHeadId.HasValue)
                    whereReadingHead = "readingHeadId=" + readingHeadId.Value;
                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(queryStartTime) && DateTime.TryParse(queryStartTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(queryEndTime) && DateTime.TryParse(queryEndTime, out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereReadingHead);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);

                List<AscmReadingHeadLog> list = AscmReadingHeadLogService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    foreach (AscmReadingHeadLog ascmReadingHeadLog in list)
                    {
                        jsonDataGridResult.rows.Add(ascmReadingHeadLog);
                    }
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #23
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult DeliveryOrderBatchNotInBatchSumList(int? page, int? rows, string sort, string order, string queryWord,
            string supplier, string warehouse, string startCreateTime, string endCreateTime, string status, string ascmStatus)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereWarehouse = "", whereAscmStatus = "";
                string whereStartCreateTime = "", whereEndCreateTime = "", whereStatus = "";
                string whereNotInSum = " id not in(select batchId from AscmDeliBatSumDetail where mainId in(select id from AscmDeliBatSumMain where status='" + AscmDeliBatSumMain.StatusDefine.unConfirm + "'))";

                if (!string.IsNullOrEmpty(supplier))
                    whereSupplier = "supplierId=" + supplier;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                DateTime dtStartCreateTime, dtEndCreateTime;
                if (!string.IsNullOrEmpty(startCreateTime) && DateTime.TryParse(startCreateTime, out dtStartCreateTime))
                    whereStartCreateTime = "createTime>='" + dtStartCreateTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endCreateTime) && DateTime.TryParse(endCreateTime, out dtEndCreateTime))
                    whereEndCreateTime = "createTime<'" + dtEndCreateTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(ascmStatus))
                {
                    if (ascmStatus == "INSTORAGE")
                        whereAscmStatus = "ascmStatus='" + ascmStatus + "'";
                    else
                        whereAscmStatus = "ascmStatus!='INSTORAGE'  or ascmStatus is null";
                }

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndCreateTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereNotInSum);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAscmStatus);

                List<AscmDeliveryOrderBatch> list = AscmDeliveryOrderBatchService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                if (list != null)
                {
                    foreach (AscmDeliveryOrderBatch ascmDeliveryOrderBatch in list)
                    {
                        jsonDataGridResult.rows.Add(ascmDeliveryOrderBatch.GetOwner());
                    }
                    jsonDataGridResult.total = ynPage.GetRecordCount();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #24
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
 public ActionResult DoorList()
 {
     List<AscmDoor> list = null;
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         list = AscmDoorService.GetInstance().GetList();
         if (list != null)
         {
             foreach (AscmDoor ascmDoor in list)
             {
                 jsonDataGridResult.rows.Add(ascmDoor.GetOwner());
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }
コード例 #25
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult DeliveryNotifyMainList(int? page, int? rows, string sort, string order, string queryWord,
            string supplier, string materialItem, string warehouse, string alert, string filter, string startReleasedTime, string endReleasedTime, string startNeedTime, string endNeedTime, string status, string employeeBuyer, string wipEntityIds)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryNotifyMain> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "", whereSupplier = "", whereMaterialItem = "", whereWarehouse = "", whereAlert = "", whereFilter = "", whereStartReleaseTime = "", whereEndReleaseTime = "";
                string whereStartNeedTime = "", whereEndNeedTime = "", whereStatus = "", whereEmployeeBuyer = "", whereWipEntityIds = "";
                if (!string.IsNullOrEmpty(supplier))
                    whereSupplier = "a.supplierId=" + supplier;
                if (!string.IsNullOrEmpty(materialItem))
                    whereMaterialItem = "a.materialId= " + materialItem;
                if (!string.IsNullOrEmpty(warehouse))
                    whereWarehouse = "a.warehouseId = '" + warehouse + "'";
                if (!string.IsNullOrEmpty(alert))
                {
                    string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    if (alert == AscmDeliveryNotifyMain.AlertDefine.alert)
                    {
                        whereAlert = "a.appointmentStartTime <='" + datetime + "' and a.appointmentEndTime >= '" + datetime + "'";
                    }
                    if (alert == AscmDeliveryNotifyMain.AlertDefine.overdue)
                    {
                        whereAlert = "a.appointmentEndTime < '" + datetime + "'";
                    }
                }
                //if (!string.IsNullOrEmpty(filter))
                //{
                //    whereFilter = "e.receivedQuantity < a.releasedquantity";
                //}

                if (!string.IsNullOrEmpty(filter))
                    whereFilter = "a.totalReceiveQuantity < a.releasedQuantity";

                if (!string.IsNullOrEmpty(wipEntityIds))
                    whereWipEntityIds = "a.wipEntityId > 0";

                if (!string.IsNullOrEmpty(status))
                    whereStatus = "status = '" + status + "'";

                if (!string.IsNullOrEmpty(employeeBuyer))
                    whereEmployeeBuyer = "a.materialId in (select id from Ascm_Material_Item where Ascm_Material_Item.buyerId=" + employeeBuyer + ")";

                DateTime dtStartReleasedTime,dtEndReleasedTime;
                if (!string.IsNullOrEmpty(startReleasedTime) && DateTime.TryParse(startReleasedTime, out dtStartReleasedTime))
                    whereStartReleaseTime = "a.releasedTime>='" + dtStartReleasedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endReleasedTime, out dtEndReleasedTime))
                    whereEndReleaseTime = "a.releasedTime<'" + dtEndReleasedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                DateTime dtStartNeedTime, dtEndNeedTime;
                if (!string.IsNullOrEmpty(startNeedTime) && DateTime.TryParse(startNeedTime, out dtStartNeedTime))
                    whereStartNeedTime = "a.needTime>='" + dtStartNeedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endNeedTime, out dtEndNeedTime))
                    whereEndNeedTime = "a.needTime<'" + dtEndNeedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereMaterialItem);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWarehouse);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereAlert);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereFilter);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereWipEntityIds);

                list = AscmDeliveryNotifyMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmDeliveryNotifyMain ascmDeliveryNotifyMain in list)
                {
                    jsonDataGridResult.rows.Add(ascmDeliveryNotifyMain.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #26
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult RfidAscxList(int? id, int? page, int? rows, string sort, string order, string q)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmRfid> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string sql = "from AscmRfid where bindType = 'FORKLIFT'";
                IList<AscmRfid> ilist = YnDaoHelper.GetInstance().nHibernateHelper.Find<AscmRfid>(sql, sql, ynPage);
                if (ilist != null && ilist.Count > 0)
                {
                    list = YnBaseClass2.Helper.ConvertHelper.ConvertIListToList<AscmRfid>(ilist);
                    foreach (AscmRfid ascmRfid in list)
                    {
                        jsonDataGridResult.rows.Add(ascmRfid);
                    }
                }

                //list = AscmRfidService.GetInstance().GetList(ynPage, "", "", q, null);
                //if (list != null)
                //{
                //    foreach (AscmRfid ascmRfid in list)
                //    {
                //        jsonDataGridResult.rows.Add(ascmRfid);
                //    }
                //}
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult,JsonRequestBehavior.AllowGet);
        }
コード例 #27
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
 public ActionResult SupplierAddressList(int? id)
 {
     List<AscmSupplierAddress> list = null;
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         if (id.HasValue)
         {
             list = AscmSupplierAddressService.GetInstance().GetList(id.Value);
             foreach (AscmSupplierAddress ascmSupplierAddress in list)
             {
                 jsonDataGridResult.rows.Add(ascmSupplierAddress.GetOwner());
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }
コード例 #28
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
        public ActionResult RfidList(int? page, int? rows, string sort, string order, string queryWord, string queryType)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmRfid> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                string whereOther = "";
                if (!string.IsNullOrEmpty(queryType))
                    whereOther = " bindType='" + queryType.Trim() + "' ";
                list = AscmRfidService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmRfid ascmRfid in list)
                {
                    jsonDataGridResult.rows.Add(ascmRfid.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #29
0
ファイル: PurchaseController.cs プロジェクト: gofixiao/Midea
        public ActionResult SupplierDeliveryNotifyMainList(int? page, int? rows, string sort, string order, string queryWord,
            string startReleasedTime, string endReleasedTime, string startNeedTime, string endNeedTime, string status, string employeeBuyer)
        {
            YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage();
            ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows;
            ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber;

            List<AscmDeliveryNotifyMain> list = null;
            JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
            try
            {
                YnFrame.Dal.Entities.YnUser ynUser = YnFrame.Web.FormsAuthenticationService.GetInstance().GetTicketUserData();
                if (ynUser == null)
                    throw new Exception("用户错误!");
                AscmUserInfo ascmUserInfo = AscmUserInfoService.GetInstance().Get(ynUser.userId);
                if (ascmUserInfo.extExpandType != "erp")
                    throw new Exception("供应商用户错误!");
                AscmUserInfoService.GetInstance().SetSupplier(ascmUserInfo);
                if (ascmUserInfo.ascmSupplier == null)
                    throw new Exception("供应商用户错误!");

                string whereOther = "", whereSupplier = "", whereStartReleaseTime = "", whereEndReleaseTime = "";
                string whereStartNeedTime = "", whereEndNeedTime = "", whereStatus = "", whereEmployeeBuyer = "";
                //if (!string.IsNullOrEmpty(supplier))
                whereSupplier = "supplierId=" + ascmUserInfo.ascmSupplier.id;
                if (!string.IsNullOrEmpty(status))
                {
                    whereStatus = "status = '" + status + "'";
                }
                else
                {
                    foreach (string s1 in MideaAscm.Dal.FromErp.Entities.AscmDeliveryNotifyMain.StatusDefine.GetSupplierList())
                    {
                        if (whereStatus != "")
                            whereStatus += ",";
                        whereStatus += "'" + s1 + "'";
                    }
                    if (whereStatus != "")
                        whereStatus = " status in (" + whereStatus + ")";
                }

                if (!string.IsNullOrEmpty(employeeBuyer))
                {
                    whereEmployeeBuyer = "materialId in (select id from AscmMaterialItem where buyerId=" + employeeBuyer + ")";
                }

                DateTime dtStartReleasedTime, dtEndReleasedTime;
                if (!string.IsNullOrEmpty(startReleasedTime) && DateTime.TryParse(startReleasedTime, out dtStartReleasedTime))
                    whereStartReleaseTime = "releasedTime>='" + dtStartReleasedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endReleasedTime, out dtEndReleasedTime))
                    whereEndReleaseTime = "releasedTime<'" + dtEndReleasedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                DateTime dtStartNeedTime, dtEndNeedTime;
                if (!string.IsNullOrEmpty(startNeedTime) && DateTime.TryParse(startNeedTime, out dtStartNeedTime))
                    whereStartNeedTime = "needTime>='" + dtStartNeedTime.ToString("yyyy-MM-dd 00:00:00") + "'";
                if (!string.IsNullOrEmpty(endReleasedTime) && DateTime.TryParse(endNeedTime, out dtEndNeedTime))
                    whereEndNeedTime = "needTime<'" + dtEndNeedTime.AddDays(1).ToString("yyyy-MM-dd 00:00:00") + "'";

                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereSupplier);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndReleaseTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStartNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEndNeedTime);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereStatus);
                whereOther = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(whereOther, whereEmployeeBuyer);

                list = AscmDeliveryNotifyMainService.GetInstance().GetList(ynPage, "", "", queryWord, whereOther);
                foreach (AscmDeliveryNotifyMain ascmDeliveryNotifyMain in list)
                {
                    jsonDataGridResult.rows.Add(ascmDeliveryNotifyMain.GetOwner());
                }
                jsonDataGridResult.total = ynPage.GetRecordCount();
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
        }
コード例 #30
0
ファイル: PublicController.cs プロジェクト: gofixiao/Midea
 public ActionResult DoorReadingHeadList(int? doorId, string sort, string order)
 {
     List<AscmReadingHead> list = null;
     JsonDataGridResult jsonDataGridResult = new JsonDataGridResult();
     try
     {
         if (doorId.HasValue)
         {
             string sql = "from AscmReadingHead where bindType='" + AscmReadingHead.BindTypeDefine.employeeCar + "' and bindId='" + doorId.Value+"'";
             list = AscmReadingHeadService.GetInstance().GetList(sql);
             foreach (AscmReadingHead ascmReadingHead in list)
             {
                 jsonDataGridResult.rows.Add(ascmReadingHead.GetOwner());
             }
         }
         //jsonDataGridResult.total = ynPage.GetRecordCount();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet);
 }