| | |
| | | } |
| | | WmsRecordUpiProcess wmsRecordUpi = new WmsRecordUpiProcess(); |
| | | wmsRecordUpi = singleUpi.Adapt<WmsRecordUpiProcess>(); |
| | | wmsRecordUpi.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wmsRecordUpi.CreateTime = DateTime.Now; |
| | | wmsRecordUpi.CreateUserName = _cretaorName; |
| | | wmsRecordUpi.Location = ""; |
| | |
| | | |
| | | WmsRecordUpiReplenish wmsRecordUpiNg = new WmsRecordUpiReplenish(); |
| | | wmsRecordUpiNg = singleUpi.Adapt<WmsRecordUpiReplenish>(); |
| | | wmsRecordUpiNg.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wmsRecordUpiNg.CreateTime = DateTime.Now; |
| | | wmsRecordUpiNg.CreateUserName = _cretaorName; |
| | | wmsRecordUpiNg.OperRemark = "人工补板"; |
| | |
| | | return package; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据包号,查询某个包下的板件数据 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [ApiDescriptionSettings(Name = "QueryUpiListByPackage")] |
| | | [Description("WmsCommonnQuery/QueryUpiListByPackage")] |
| | | public async Task<List<Mes_BatchOrderUPI_New>> QueryUpiListByPackage(QueryPackageInput input) |
| | | { |
| | | if (input == null || input.PackageCode == null) |
| | | { |
| | | throw Oops.Oh("参数不能为空"); |
| | | } |
| | | |
| | | var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); |
| | | if (package == null) |
| | | { |
| | | throw Oops.Oh($"没有找到包号{input.PackageCode}的汇总数据"); |
| | | } |
| | | |
| | | var upiList = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).ToListAsync(); |
| | | |
| | | return upiList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据某个Upi,查询某个包下的板件数据 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [ApiDescriptionSettings(Name = "QueryUpiListByUpi")] |
| | | [Description("WmsCommonnQuery/QueryUpiListByUpi")] |
| | | public async Task<List<Mes_BatchOrderUPI_New>> QueryUpiListByUpi(QueryUpiListByUpiInput input) |
| | | { |
| | | if (input == null || input.Upi == null) |
| | | { |
| | | throw Oops.Oh("参数不能为空"); |
| | | } |
| | | |
| | | var singleUpi = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.UPI == input.Upi).FirstAsync(); |
| | | if (singleUpi == null) |
| | | { |
| | | throw Oops.Oh($"没有找到部件条码{input.Upi}的数据"); |
| | | } |
| | | |
| | | var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == singleUpi.PackageCode).FirstAsync(); |
| | | if (package == null) |
| | | { |
| | | throw Oops.Oh($"没有找到包号{singleUpi.PackageCode}的汇总数据"); |
| | | } |
| | | |
| | | var upiList = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.PackageCode == singleUpi.PackageCode).ToListAsync(); |
| | | |
| | | return upiList; |
| | | } |
| | | |
| | | } |
| | | |