| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 | 
							- using SqlSugar;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Text;
 
- using wms.dataservice.IDataSetvice;
 
- using wms.dto;
 
- using wms.dto.request;
 
- using wms.dto.request.hj.dto;
 
- using wms.sqlsugar;
 
- using wms.sqlsugar.model.hj;
 
- namespace wms.dataservice.DataService
 
- {
 
-     public class HJDataService: IHJDataService
 
-     {
 
-         Repository<hjBaseWareLocation> _baseWareLocationrepository => new Repository<hjBaseWareLocation>();
 
-         Repository<hjBillDocument> _billDocument => new Repository<hjBillDocument>();
 
-         /// <summary>
 
-         /// 二升位有出库任务的一升位有货(无任务)货位
 
-         /// </summary>
 
-         /// <param name="reqEntity"></param>
 
-         /// <returns></returns>
 
-         public List<hjBaseWareLocation> GetLocationDept1WithDept2Stock(ApplyStockOutRequest reqEntity)
 
-         {
 
-             //var list = _baseWareLocationrepository.Context.Queryable<hjBaseWareLocation, hjBaseWareLocation, hjBaseEquipment>((location1, location2, equipment) => new object[] {
 
-             //     JoinType.Inner,location1.ShelfCode == location2.ShelfCode && location1.LogicCol == location2.LogicCol && location1.LogicLayer == location2.LogicLayer && location1.ZoneId == location2.ZoneId,
 
-             //     JoinType.Inner,house.Id  == equipment.WarehouseId && location1.Tunnel == equipment.Tunnel && equipment.EquipType == BaseDictionaryConst.EquipType_PlierCode
 
-             //     })
 
-             //   .Where((location1, zone, house, location2, equipment) => location1.Status == 1 && location1.IsDelete == 0 && location2.Status == 1 && location2.IsDelete == 0 && zone.IsDelete == 0 && zone.Status == 1 && house.IsDelete == 0 && house.Status == 1)
 
-             //   .Where((location1, zone, house, location2, equipment) => location1.LocationType == DictionaryConst.LocationTypeStorageCode && location1.LocationState == DictionaryConst.LocationStateStockCode && (string.IsNullOrEmpty(location1.LocationLock) || location1.LocationLock == DictionaryConst.LocationLockNoneCode))
 
-             //   .Where((location1, zone, house, location2, equipment) => location2.LocationType == DictionaryConst.LocationTypeStorageCode && location2.LocationState == DictionaryConst.LocationStateStockCode && location2.LocationLock == DictionaryConst.LocationLockStockOutCode)
 
-             //   .WhereIF(!string.IsNullOrEmpty(reqEntity.LocationType), (location1, zone, house, location2, equipment) => reqEntity.LocationType == location1.LocationType)
 
-             //   .WhereIF(!string.IsNullOrEmpty(reqEntity.Tunnel), (location1, zone, house, location2, equipment) => location1.Tunnel == reqEntity.Tunnel)
 
-             //   .WhereIF(!string.IsNullOrEmpty(reqEntity.Size), (location1, zone, house, location2, equipment) => int.Parse(location1.Size) >= int.Parse(reqEntity.Size))
 
-             //   .WhereIF(reqEntity.ZoneId > 0, (location1, zone, house, location2, equipment) => zone.Id == reqEntity.ZoneId)
 
-             //   .WhereIF(reqEntity.WarehouseId > 0, (location1, zone, house, location2, equipment) => zone.WarehouseId == reqEntity.WarehouseId)
 
-             //   .WhereIF(reqEntity.LocationId > 0, (location1, zone, house, location2, equipment) => location1.Id == reqEntity.LocationId)
 
-             //   .WhereIF(!string.IsNullOrEmpty(reqEntity.ShelfCode), (location1, zone, house, location2, equipment) => location1.ShelfCode == reqEntity.ShelfCode)
 
-             //   .WhereIF(reqEntity.IsExceptErrorPlier, (location1, zone, house, location2, equipment) => equipment.EquipState != BaseDictionaryConst.PlierRuningState_ErrorCode)
 
-             //.Select((location1, zone, house, location2, equipment) => location1);
 
-             // return list.ToList();
 
-             return null;
 
-         }
 
-         public (List<DocumentsResponse>, int) GetPageDocumentsList(DocumentsRequest request)
 
-         {
 
-             int count = 0;
 
-             var list = _billDocument.Context.Queryable<BillDocsinfo, BaseWarehouse>((document, house) => new object[]
 
-             {
 
-                 JoinType.Left, document.WarehouseId == house.Id
 
-             })
 
-             .WhereIF(!string.IsNullOrEmpty(request.DocsNo), (document, house) => document.DocsNo.Contains(request.DocsNo))
 
-             .WhereIF(!string.IsNullOrEmpty(request.ReqNo), (document, house) => document.ReqNo.Contains(request.ReqNo))
 
-             .WhereIF(!string.IsNullOrEmpty(request.StateCode), (document, house) => document.StateNum == int.Parse(request.StateCode))
 
-             .WhereIF(!string.IsNullOrEmpty(request.TypeCode), (document, house) => document.TypeNum == int.Parse(request.TypeCode))
 
-             .Select((document, house) => new DocumentsResponse()
 
-             {
 
-                 Id = document.Id,
 
-                 WarehouseCode = house.Code,
 
-                 DocNo = document.DocsNo,
 
-                 ReqNo = document.ReqNo,
 
-                 TypeCode = document.TypeNum.ToString(),
 
-                 StateCode = document.StateNum.ToString(),
 
-                 DownQty = document.DownQty,
 
-                 //DownErrReason = document.DownErrReason,
 
-                 //Remark = document.Remark,
 
-                 AddWho = document.AddWho,
 
-                 EditWho = document.EditWho,
 
-                 AddTime = document.AddTime,
 
-                 EditTime = document.EditTime
 
-             })
 
-             .ToPageList(request.PageIndex, request.PageSize, ref count);
 
-             //list = list.Skip((request.PageIndex - 1) * request.PageSize).Take(request.PageSize).ToList();
 
-             return (list.ToList(), count);
 
-         }
 
-         public List<string> GetStockByEquip(string code)
 
-         {
 
-             var list = _baseWareLocationrepository.Context.Queryable<hjBaseWareLocation, hjBillContainer>((location, stock) => new object[]
 
-             {
 
-                 JoinType.Inner, stock.ContGrpId == location.ContGrpID,
 
-             })
 
-             .Where((location, stock) => stock.ExecState == InvState.InvEcecState_BuildUp.GetHashCode())
 
-             .WhereIF(!string.IsNullOrEmpty(code), (location, stock) => location.Code.Contains(code))
 
-             .Select((location, stock) => stock.HWBarCode).ToList();
 
-             return list;
 
-         }
 
-         public (List<DocumentsdetailList>, int) GetDocumentDetailListByDocsNo(DocumentsRequest request)
 
-         {
 
-             int count = 0;
 
-             var list = _billDocument.Context.Queryable<hjBillDocument, hjBillBarcode, hjBaseMater, hjBillContainer, hjBaseWareLocation>((document, barcode, mater, container, location) => new object[]
 
-             {
 
-                 JoinType.Inner, document.DocNo == barcode.InDocsNo,
 
-                 JoinType.Inner, barcode.MatId == mater.Id,
 
-                 JoinType.Inner, barcode.RFIDBarCode == container.RFIDBarCode,
 
-                 JoinType.Inner, container.ContGrpId == location.ContGrpID
 
-             })
 
-             .Where((document, barcode, mater, container, location) => container.ExecState == InvState.InvEcecState_In.GetHashCode() && location.LocationState == LocationState.LocationState_Full.GetHashCode()
 
-              )
 
-             .WhereIF(!string.IsNullOrEmpty(request.DocsNo), (document, barcode, mater, container, location) => document.DocNo.Contains(request.DocsNo))
 
-             .WhereIF(!string.IsNullOrEmpty(request.Rfid), (document, barcode, mater, container, location) => container.RFIDBarCode.Contains(request.Rfid))
 
-             .WhereIF(!string.IsNullOrEmpty(request.location), (document, barcode, mater, container, location) => location.Code.Contains(request.location))
 
-             .Select((document, barcode, mater, container, location) => new DocumentsdetailList()
 
-             {
 
-                 WarehouseCode = location.WareCode,
 
-                 MatCode = mater.Code,
 
-                 MatName = mater.Name,
 
-                 Location = location.Code,
 
-                 RFIDBarCode = barcode.RFIDBarCode,
 
-                 HWSpec = barcode.HWSpec,
 
-                 IsFast = barcode.IsFast,
 
-                 Grade = barcode.Grade
 
-             })
 
-             .ToPageList(request.PageIndex, request.PageSize, ref count);
 
-             //list = list.Skip((request.PageIndex - 1) * request.PageSize).Take(request.PageSize).ToList();
 
-             return (list.ToList(), count);
 
-         }
 
-     }
 
- }
 
 
  |