Merge branch 'development'
This commit is contained in:
@@ -303,7 +303,7 @@ public class BalanceService : IBalanceService
|
||||
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
||||
.WhereIF(request.ApplicationType.HasValue, record => record.ApplicationType == request.ApplicationType)
|
||||
.Where((record, ga) => ga.Code == jinkoCode)
|
||||
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
||||
.OrderBy(record => record.CostDateTime)
|
||||
.Select((record, ga, department, bPlace) => new BalanceRecordUserPageResponse
|
||||
{
|
||||
Id = record.Id,
|
||||
@@ -523,20 +523,21 @@ public class BalanceService : IBalanceService
|
||||
await _dbContext.InsertAsync(gainfoMeal);
|
||||
}
|
||||
|
||||
var businessPlace = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||
var businessPlaceInfo = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((a, b) => a.Code == b.PlaceCode)
|
||||
.LeftJoin<BusinessShiftEntity>((a, b, c) => b.ShiftCode == c.Code)
|
||||
.Where((a, b, c) => a.CustomCode == request.BusinessPlaceCode)
|
||||
.Select((a, b, c) => new
|
||||
{
|
||||
a.Code,
|
||||
ShiftCode = c.Code
|
||||
ShiftCode = c.Code,
|
||||
a.TenantId
|
||||
})
|
||||
.SingleAsync();
|
||||
|
||||
if (request.Type == BalanceRecordTypeEnumType.Out)
|
||||
{
|
||||
businessPlace.ThrowIfNull($"营业点{request.BusinessPlaceCode}不存在");
|
||||
businessPlaceInfo.ThrowIfNull($"营业点{request.BusinessPlaceCode}不存在");
|
||||
}
|
||||
|
||||
await _dbContext.InsertAsync(new BalanceRecordEntity
|
||||
@@ -544,8 +545,8 @@ public class BalanceService : IBalanceService
|
||||
Amount = request.Amount,
|
||||
ApplicationType = request.ApplicationType,
|
||||
Type = request.Type,
|
||||
BusinessPlaceCode = businessPlace?.Code,
|
||||
BusinessShiftCode = businessPlace?.ShiftCode,
|
||||
BusinessPlaceCode = businessPlaceInfo?.Code,
|
||||
BusinessShiftCode = businessPlaceInfo?.ShiftCode,
|
||||
ShiftType = request.ShiftType,
|
||||
CostDate = request.CostDate,
|
||||
CostDateTime = request.CostDateTime,
|
||||
@@ -557,7 +558,7 @@ public class BalanceService : IBalanceService
|
||||
Remark = request.Remark,
|
||||
CostId = gainfo.CostId,
|
||||
SubsidiesFromMonth = request.CostDate.ToString("yyyyMM"),
|
||||
TenantId = request.Factory,
|
||||
TenantId = businessPlaceInfo?.TenantId ?? request.Factory,
|
||||
OriginTenantId = gainfo.Factory,
|
||||
Werks = gainfo.Werks,
|
||||
Name = gainfo.Name,
|
||||
@@ -621,7 +622,7 @@ public class BalanceService : IBalanceService
|
||||
.Where(x => x.Code == request.UserCode)
|
||||
.SingleAsync();
|
||||
|
||||
(gainfo == null).ThrowIfTrue($"工号{request.UserCode}不存在");
|
||||
gainfo.ThrowIfNull($"工号{request.UserCode}不存在");
|
||||
|
||||
await _dbContext.InsertAsync(new BalanceRecordEntity
|
||||
{
|
||||
@@ -686,7 +687,7 @@ public class BalanceService : IBalanceService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task ReCalcAsync(BalanceReCalcRequest request)
|
||||
{
|
||||
await CommonHelper.RetryAsync(async () =>
|
||||
|
||||
Reference in New Issue
Block a user