|
|
@ -7,12 +7,14 @@ using System.Text; |
|
|
|
using System.Text.Json; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Castle.Components.DictionaryAdapter; |
|
|
|
using IdentityServer4.Extensions; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using MyNamespace; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Domain.Entities; |
|
|
|
using Volo.Abp.ObjectMapping; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Volo.Abp.Users; |
|
|
@ -208,7 +210,18 @@ public class CoatingIssueJobAppService |
|
|
|
{ |
|
|
|
var coatingIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); |
|
|
|
coatingIssueJob.JobStatus = EnumJobStatus.Doing; |
|
|
|
|
|
|
|
if (coatingIssueJob.IsClaims) |
|
|
|
{ |
|
|
|
if (coatingIssueJob.ClaimsUserId != _currentUser.Id.ToString()) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"该任务已被【{coatingIssueJob.ClaimsUserName}】承接"); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("该任务未被承接,请重新刷新页面,承接任务"); |
|
|
|
} |
|
|
|
|
|
|
|
var coatingIssueJobDto = ObjectMapper.Map<CoatingIssueJob, CoatingIssueJobDTO>(coatingIssueJob); |
|
|
|
|
|
|
|
var fromLocationDto=await _locationAppService.GetByCodeAsync(issueJobDetailDto.HandledFromLocationCode).ConfigureAwait(false); |
|
|
@ -265,6 +278,7 @@ public class CoatingIssueJobAppService |
|
|
|
} |
|
|
|
|
|
|
|
await _repository.UpdateAsync(coatingIssueJob).ConfigureAwait(false); |
|
|
|
await CancelAcceptAsync(masterId).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -310,6 +324,11 @@ public class CoatingIssueJobAppService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 承接任务
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("accept/{id}")] |
|
|
|
[UnitOfWork] |
|
|
|
public override async Task AcceptAsync(Guid id) |
|
|
|