fix 增加厂区查询

This commit is contained in:
2025-12-23 09:41:41 +08:00
parent 429b9c0e1a
commit bc94f9ed72
2 changed files with 6 additions and 0 deletions

View File

@@ -221,6 +221,7 @@ public class BirthdayVoucherService : BaseVoucherService, IVoucherService
return await DbContext.Queryable<BalanceRecordEntity>()
.LeftJoin<BusinessPlaceEntity>((x, bPlace) => x.BusinessPlaceCode == bPlace.Code)
.LeftJoin<DepartmentEntity>((x, bPlace, department) => x.DepartmentNo == department.No)
.WhereIF(request.Factories.IsPresent(), x => request.Factories.Contains(x.TenantId))
.WhereIF(request.UserCode.IsPresent(), x => x.UserCode == request.UserCode)
.WhereIF(request.SearchDateTimePeriod.HasValue(), x => x.CostDate >= request.SearchDateTimePeriod.Start && x.CostDate <= request.SearchDateTimePeriod.End) //成本日期
.Where(x => x.Status == BalanceRecordStatusEnumType.Valid && x.Type == BalanceRecordTypeEnumType.Out) //有效,消费数据