fix import餐饮人员创建
This commit is contained in:
@@ -101,6 +101,11 @@ public class BalanceHainingImportRequest : IValidatableObject
|
||||
{
|
||||
yield return new ValidationResult("仅支持设备消费", new[] { nameof(ApplicationType) });
|
||||
}
|
||||
|
||||
if (BusinessPlaceCode.IsEmpty())
|
||||
{
|
||||
yield return new ValidationResult("营业掉不可为空", new[] { nameof(BusinessPlaceCode) });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -500,6 +500,22 @@ public class BalanceService : IBalanceService
|
||||
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == request.UserCode).SingleAsync();
|
||||
gainfo.ThrowIfNull($"工号{request.UserCode}不存在");
|
||||
var gainfoMeal = await _dbContext.Queryable<GainfoMealEntity>().Where(x => x.UserCode == request.UserCode).SingleAsync();
|
||||
if (gainfoMeal == null)
|
||||
{
|
||||
gainfoMeal = new GainfoMealEntity
|
||||
{
|
||||
CreatedBy = 1,
|
||||
ModifiedBy = 1,
|
||||
UserNo = gainfo.No,
|
||||
UserCode = gainfo.Code,
|
||||
Balance = 0,
|
||||
BalanceOfRecharge = 0,
|
||||
BalanceOfSubsidies = 0,
|
||||
Version = 0
|
||||
};
|
||||
|
||||
await _dbContext.InsertAsync(gainfoMeal);
|
||||
}
|
||||
|
||||
var businessPlace = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((a, b) => a.Code == b.PlaceCode)
|
||||
|
||||
Reference in New Issue
Block a user