Yanko 3 months ago
parent
commit
f60c1f9db3
5 changed files with 25 additions and 5 deletions
  1. +5
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  2. +1
    -1
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs
  3. +4
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkPlanDto.cs
  4. +6
    -3
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs
  5. +9
    -1
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkPlanService.cs

+ 5
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml View File

@@ -9687,6 +9687,11 @@
</summary>
<example></example>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkPlanOutput.FinalName">
<summary>
成品名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkPlanOutput.DateRange">
<summary>
时间段


+ 1
- 1
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs View File

@@ -39,7 +39,7 @@
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
public DateTime CreateTime { get; set; }
public int MessageId { get; set; }

public Version MsgVersion { get; set; }


+ 4
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkPlanDto.cs View File

@@ -76,6 +76,10 @@ namespace BPA.MES.Base.Application.Services
/// <example></example>
public string Id { get; set; }
/// <summary>
/// 成品名称
/// </summary>
public string FinalName { get; set; }
/// <summary>
/// 时间段
/// </summary>
public string[] DateRange { get {


+ 6
- 3
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs View File

@@ -1,5 +1,6 @@
using BPA.MES.Base.Application.Entitys.Base;
using Furion.EventBus;
using Microsoft.AspNetCore.Cors.Infrastructure;
using System.Security.Cryptography;
using Yitter.IdGenerator;

@@ -192,7 +193,8 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
Number = a.Number,
FinalId = a.FinalId,
LineId = a.LineId,
DeviceCode = a.DeviceId
DeviceCode = a.DeviceId,
CreateTime = a.CreateTime
}).ToListAsync();
return entity;
}
@@ -576,7 +578,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
try
{
_dbContext.Ado.BeginTran();
await _dbContext.Updateable(entity).Where(x=>x.Id==input.Id).IgnoreColumns(true).ExecuteCommandAsync();
await _dbContext.Updateable(entity).Where(x => x.Id==input.Id).IgnoreColumns(true).ExecuteCommandAsync();
await _dbContext.Deleteable<WorkDeviceRecordEntity>().Where(x => x.WorkId==input.Id).ExecuteCommandAsync();
if (workDeviceRecordEntities.Count>1)
{
@@ -725,7 +727,8 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
[HttpGet]
public async Task<WorkInfoEditDetailOutput> EditDetail(string Id)
{
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>()
WorkInfoEditDetailOutput entity = new();
entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>()
.LeftJoin<WorkPlanEntity>((a, b) => a.PlanId == b.Id)
.LeftJoin<Pztj_FinalsInfoEntity>((a, b, c) => a.FinalId == c.Id)
.Where((a, b, c) => a.Id == Id)


+ 9
- 1
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkPlanService.cs View File

@@ -57,7 +57,15 @@ namespace BPA.MES.Base.Application.Services
[HttpGet]
public async Task<WorkPlanOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<WorkPlanEntity>().FirstAsync();
var entity = await _dbContext.Queryable<WorkPlanEntity>()
.LeftJoin<Pztj_FinalsInfoEntity>((a,b)=>a.FinalId==b.Id)
.Where((a,b)=>a.Id==Id)
.Select((a,b)=>new WorkPlanOutput
{
Id = a.Id.SelectAll(),
FinalName = b.Name
})
.FirstAsync();
WorkPlanOutput output = entity.Adapt<WorkPlanOutput>();
return output;
}


Loading…
Cancel
Save