Browse Source

修改 发料任务承接

dev_DY_CC
郑勃旭 11 months ago
parent
commit
1c809ba320
  1. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  2. 19
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs
  3. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs
  4. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs
  5. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs

@ -210,6 +210,17 @@ public class AssembleIssueJobAppService
{ {
var assembleIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); var assembleIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false);
assembleIssueJob.JobStatus = EnumJobStatus.Doing; assembleIssueJob.JobStatus = EnumJobStatus.Doing;
if (assembleIssueJob.IsClaims)
{
if (assembleIssueJob.ClaimsUserId != _currentUser.Id.ToString())
{
throw new UserFriendlyException($"该任务已被【{assembleIssueJob.ClaimsUserName}】承接");
}
}
else
{
throw new UserFriendlyException("该任务未被承接,请重新刷新页面,承接任务");
}
var assembleIssueJobDto = ObjectMapper.Map<AssembleIssueJob, AssembleIssueJobDTO>(assembleIssueJob); var assembleIssueJobDto = ObjectMapper.Map<AssembleIssueJob, AssembleIssueJobDTO>(assembleIssueJob);
assembleIssueJobDto.Details = new List<AssembleIssueJobDetailDTO> { issueJobDetailDto }; assembleIssueJobDto.Details = new List<AssembleIssueJobDetailDTO> { issueJobDetailDto };
@ -253,6 +264,7 @@ public class AssembleIssueJobAppService
} }
await _repository.UpdateAsync(assembleIssueJob).ConfigureAwait(false); await _repository.UpdateAsync(assembleIssueJob).ConfigureAwait(false);
await CancelAcceptAsync(masterId).ConfigureAwait(false);
} }
/// <summary> /// <summary>

19
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs

@ -7,12 +7,14 @@ using System.Text;
using System.Text.Json; using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter; using Castle.Components.DictionaryAdapter;
using IdentityServer4.Extensions;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using MyNamespace; using MyNamespace;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Volo.Abp.Users; using Volo.Abp.Users;
@ -208,6 +210,17 @@ public class CoatingIssueJobAppService
{ {
var coatingIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); var coatingIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false);
coatingIssueJob.JobStatus = EnumJobStatus.Doing; 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 coatingIssueJobDto = ObjectMapper.Map<CoatingIssueJob, CoatingIssueJobDTO>(coatingIssueJob);
@ -265,6 +278,7 @@ public class CoatingIssueJobAppService
} }
await _repository.UpdateAsync(coatingIssueJob).ConfigureAwait(false); await _repository.UpdateAsync(coatingIssueJob).ConfigureAwait(false);
await CancelAcceptAsync(masterId).ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -310,6 +324,11 @@ public class CoatingIssueJobAppService
} }
} }
/// <summary>
/// 承接任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("accept/{id}")] [HttpPost("accept/{id}")]
[UnitOfWork] [UnitOfWork]
public override async Task AcceptAsync(Guid id) public override async Task AcceptAsync(Guid id)

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs

@ -202,6 +202,17 @@ public class InjectionIssueJobAppService
{ {
var injectionIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); var injectionIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false);
injectionIssueJob.JobStatus = EnumJobStatus.Doing; injectionIssueJob.JobStatus = EnumJobStatus.Doing;
if (injectionIssueJob.IsClaims)
{
if (injectionIssueJob.ClaimsUserId != _currentUser.Id.ToString())
{
throw new UserFriendlyException($"该任务已被【{injectionIssueJob.ClaimsUserName}】承接");
}
}
else
{
throw new UserFriendlyException("该任务未被承接,请重新刷新页面,承接任务");
}
var injectionIssueJobDto = ObjectMapper.Map<InjectionIssueJob, InjectionIssueJobDTO>(injectionIssueJob); var injectionIssueJobDto = ObjectMapper.Map<InjectionIssueJob, InjectionIssueJobDTO>(injectionIssueJob);
injectionIssueJobDto.Details = new List<InjectionIssueJobDetailDTO> { issueJobDetailDto }; injectionIssueJobDto.Details = new List<InjectionIssueJobDetailDTO> { issueJobDetailDto };
@ -244,6 +255,7 @@ public class InjectionIssueJobAppService
} }
await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false); await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false);
await CancelAcceptAsync(masterId).ConfigureAwait(false);
} }
/// <summary> /// <summary>

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs

@ -201,6 +201,17 @@ public class KittingIssueJobAppService
{ {
var kittingIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); var kittingIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false);
kittingIssueJob.JobStatus = EnumJobStatus.Doing; kittingIssueJob.JobStatus = EnumJobStatus.Doing;
if (kittingIssueJob.IsClaims)
{
if (kittingIssueJob.ClaimsUserId != _currentUser.Id.ToString())
{
throw new UserFriendlyException($"该任务已被【{kittingIssueJob.ClaimsUserName}】承接");
}
}
else
{
throw new UserFriendlyException("该任务未被承接,请重新刷新页面,承接任务");
}
var kittingIssueJobDto = ObjectMapper.Map<KittingIssueJob, KittingIssueJobDTO>(kittingIssueJob); var kittingIssueJobDto = ObjectMapper.Map<KittingIssueJob, KittingIssueJobDTO>(kittingIssueJob);
kittingIssueJobDto.Details = new List<KittingIssueJobDetailDTO> { issueJobDetailDto }; kittingIssueJobDto.Details = new List<KittingIssueJobDetailDTO> { issueJobDetailDto };
@ -243,6 +254,7 @@ public class KittingIssueJobAppService
} }
await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false);
await CancelAcceptAsync(masterId).ConfigureAwait(false);
} }
/// <summary> /// <summary>

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs

@ -194,6 +194,17 @@ public class SparePartIssueJobAppService
{ {
var sparePartIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); var sparePartIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false);
sparePartIssueJob.JobStatus = EnumJobStatus.Doing; sparePartIssueJob.JobStatus = EnumJobStatus.Doing;
if (sparePartIssueJob.IsClaims)
{
if (sparePartIssueJob.ClaimsUserId != _currentUser.Id.ToString())
{
throw new UserFriendlyException($"该任务已被【{sparePartIssueJob.ClaimsUserName}】承接");
}
}
else
{
throw new UserFriendlyException("该任务未被承接,请重新刷新页面,承接任务");
}
var sparePartIssueJobDto = ObjectMapper.Map<SparePartIssueJob, SparePartIssueJobDTO>(sparePartIssueJob); var sparePartIssueJobDto = ObjectMapper.Map<SparePartIssueJob, SparePartIssueJobDTO>(sparePartIssueJob);
sparePartIssueJobDto.Details = new List<SparePartIssueJobDetailDTO> { issueJobDetailDto }; sparePartIssueJobDto.Details = new List<SparePartIssueJobDetailDTO> { issueJobDetailDto };
@ -236,6 +247,7 @@ public class SparePartIssueJobAppService
} }
await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false); await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false);
await CancelAcceptAsync(masterId).ConfigureAwait(false);
} }
/// <summary> /// <summary>

Loading…
Cancel
Save