fix 统计,消费明细

This commit is contained in:
2024-08-15 16:49:50 +08:00
parent 83a6c0e8bb
commit 173ede9222
23 changed files with 342 additions and 175 deletions

View File

@@ -1,3 +1,4 @@
using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Canteen.Entities;
using Dlhis.Entity.Canteen.Enums;
using Dlhis.External.EMealVoucher.Request;
@@ -19,6 +20,9 @@ public class EMealVoucherService : IEMealVoucherService
{
(await _dbContext.Queryable<EMealVoucherEntity>().Where(x => x.No == request.No).AnyAsync()).ThrowIfTrue($"{request.No}已存在");
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == request.Code).SingleAsync();
gainfo.ThrowIfNull("申请人不存在");
var voucher = new EMealVoucherEntity
{
No = request.No,
@@ -31,7 +35,8 @@ public class EMealVoucherService : IEMealVoucherService
Reason = request.Reason,
Shifts = request.Shifts.Select(x => (ShiftEnumType)x).ToList(),
Date = request.Date,
Factories = request.Factories
Factories = request.Factories,
Factory = gainfo.Factory
};
var details = request.Details.Select(x => new EMealVoucherDetailEntity