| | |
| | | .ProjectToType<WmsControlRuleDetailOutput>() |
| | | .ToListAsync(); |
| | | |
| | | //物料客户关联 |
| | | var wmsMaterialCustomerList = await _wmsMaterialCustomerRep.DetachedEntities |
| | | .Where(u => u.MaterialId == wmsMaterialInfo.Id) |
| | | .Where(u => u.IsDeleted == false) |
| | | .OrderBy(o => o.CreatedTime) |
| | | .ProjectToType<WmsMaterialCustomerOutput>() |
| | | .ToListAsync(); |
| | | List<long> custIds = wmsMaterialCustomerList.Select(s => s.CustId).ToList(); |
| | | //根据物料客户关联表获取往来信息 |
| | | var baseCustomers = await _baseCustomerRep.DetachedEntities.Join(_wmsMaterialCustomerRep.DetachedEntities, bc => bc.Id, mc => mc.CustId, (bc, mc) => new { bc, mc }) |
| | | .Where(p =>p.mc.MaterialId== wmsMaterialInfo.Id) |
| | | .OrderBy(o => o.mc.CreatedTime) |
| | | var baseCustomers = await _baseCustomerRep.DetachedEntities |
| | | .Where(p => custIds.Contains(p.Id)) |
| | | .OrderBy(o => o.CreatedTime) |
| | | .ProjectToType<BaseCustomerOutput>() |
| | | .ToListAsync(); |
| | | |
| | | |
| | | resultInfo.MaterialInfo = wmsMaterialInfo; |
| | | resultInfo.SubstituteGoodList = wmsSubstituteGoods; |
| | | resultInfo.ControlRuleDetailList = wmsControlRuleDetails; |
| | | resultInfo.BaseCustomerList = baseCustomers; |
| | | return resultInfo; |
| | | } |
| | | |