Example #1
0
        public IHttpActionResult QueryStorageCheckByUidAPI(int Storage_Check_UID)
        {
            var dto    = storageManageService.QueryStorageCheckSingle(Storage_Check_UID);
            var result = new StorageCheckDTO
            {
                Storage_Check_UID     = dto[0].Storage_Check_UID,
                PartType_UID          = dto[0].PartType_UID,
                PartType              = dto[0].PartType,
                Material_Uid          = dto[0].Material_Uid,
                Material_Id           = dto[0].Material_Id,
                Material_Name         = dto[0].Material_Name,
                Material_Types        = dto[0].Material_Types,
                Warehouse_Storage_UID = dto[0].Warehouse_Storage_UID,
                Warehouse_ID          = dto[0].Warehouse_ID,
                Rack_ID    = dto[0].Rack_ID,
                Storage_ID = dto[0].Storage_ID,
                Check_Qty  = dto[0].Check_Qty,
                Status     = dto[0].Status
            };

            return(Ok(result));
        }
Example #2
0
        public IHttpActionResult ApproveStorageCheckAPI(StorageCheckDTO search)
        {
            var result = storageManageService.ApproveStorageCheck(search);

            return(Ok(result));
        }
Example #3
0
        public IHttpActionResult DoAllExportStorageCheckReprotAPI(StorageCheckDTO search)
        {
            var result = storageManageService.DoAllExportStorageCheckReprot(search);

            return(Ok(result));
        }
Example #4
0
 public string AddOrEditStorageCheckAPI(StorageCheckDTO dto)
 {
     return(storageManageService.AddOrEditStorageCheck(dto));
 }
Example #5
0
        public IQueryable <StorageCheckDTO> GetInfo(StorageCheckDTO searchModel, Page page, out int totalcount)
        {
            var query = from M in DataContext.Storage_Check
                        join status in DataContext.Enumeration on
                        M.Status_UID equals status.Enum_UID
                        join mat in DataContext.Material_Info on
                        M.Material_UID equals mat.Material_Uid
                        join warst in DataContext.Warehouse_Storage on
                        M.Warehouse_Storage_UID equals warst.Warehouse_Storage_UID
                        join war in DataContext.Warehouse on
                        warst.Warehouse_UID equals war.Warehouse_UID
                        join appuser in DataContext.System_Users on
                        M.Applicant_UID equals appuser.Account_UID
                        join apruser in DataContext.System_Users on
                        M.Applicant_UID equals apruser.Account_UID
                        join checkenum in DataContext.Enumeration on
                        M.PartType_UID equals checkenum.Enum_UID
                        select new StorageCheckDTO
            {
                Storage_Check_UID   = M.Storage_Check_UID,
                Storage_Check_ID    = M.Storage_Check_ID,
                PartType            = checkenum.Enum_Value,
                Status              = status.Enum_Value,
                Material_Id         = mat.Material_Id,
                Material_Name       = mat.Material_Name,
                Material_Types      = mat.Material_Types,
                Warehouse_ID        = war.Warehouse_ID,
                Rack_ID             = warst.Rack_ID,
                Storage_ID          = warst.Storage_ID,
                Check_Qty           = M.Check_Qty,
                PartType_UID        = M.PartType_UID,
                ApplicantUser       = appuser.User_Name,
                Applicant_Date      = M.Applicant_Date,
                ApproverUser        = apruser.User_Name,
                Approver_Date       = M.Approver_Date,
                Status_UID          = M.Status_UID,
                BG_Organization_UID = war.BG_Organization_UID
            };

            if (searchModel.PartType_UID != 0)
            {
                query = query.Where(m => m.PartType_UID == searchModel.PartType_UID);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Material_Id))
            {
                query = query.Where(m => m.Material_Id.Contains(searchModel.Material_Id));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Material_Name))
            {
                query = query.Where(m => m.Material_Name.Contains(searchModel.Material_Name));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Material_Types))
            {
                query = query.Where(m => m.Material_Types.Contains(searchModel.Material_Types));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Warehouse_ID))
            {
                query = query.Where(m => m.Warehouse_ID.Contains(searchModel.Warehouse_ID));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Rack_ID))
            {
                query = query.Where(m => m.Rack_ID.Contains(searchModel.Rack_ID));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Storage_ID))
            {
                query = query.Where(m => m.Storage_ID.Contains(searchModel.Storage_ID));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.ApplicantUser))
            {
                query = query.Where(m => m.ApplicantUser.Contains(searchModel.ApplicantUser));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.ApproverUser))
            {
                query = query.Where(m => m.ApproverUser.Contains(searchModel.ApproverUser));
            }
            if (searchModel.Status_UID != 0)
            {
                query = query.Where(m => m.Status_UID == searchModel.Status_UID);
            }
            else
            {
                //fky2017/11/13
                //query = query.Where(m => m.Status_UID != 392);
                query = query.Where(m => m.Status_UID != 420);
            }
            List <int> Plant_UIDs = GetOpType(searchModel.Plant_UID).Select(o => o.Organization_UID).ToList();

            if (Plant_UIDs.Count > 0)
            {
                query = query.Where(m => Plant_UIDs.Contains(m.BG_Organization_UID));
            }
            totalcount = query.Count();
            query      = query.OrderByDescending(m => m.Applicant_Date).GetPage(page);
            return(query);
        }