소스 검색

MES整改

master
Yanko 2 달 전
부모
커밋
13ab75234f
10개의 변경된 파일996개의 추가작업 그리고 1개의 파일을 삭제
  1. +426
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  2. +26
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/ProcessEntity.cs
  3. +26
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/ProductLineStepsEntity.cs
  4. +84
    -0
      backend/BPA.MES.Base.Application/Services/ProcessEntity/Dtos/ProcessDto.cs
  5. +48
    -0
      backend/BPA.MES.Base.Application/Services/ProcessEntity/Services/IProcessService.cs
  6. +110
    -0
      backend/BPA.MES.Base.Application/Services/ProcessEntity/Services/ProcessService.cs
  7. +94
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStepsDto.cs
  8. +48
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineStepsService.cs
  9. +133
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineStepsService.cs
  10. +1
    -1
      backend/BPA.MES.Base.Web.Entry/appsettings.json

+ 426
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml 파일 보기

@@ -997,6 +997,31 @@
描 述 :
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.ProcessEntity">
<summary>
工艺流程库
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProcessEntity.Name">
<summary>
工艺流程名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProcessEntity.ProcessType">
<summary>
流程类型
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProcessEntity.Des">
<summary>
备注
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProcessEntity.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.ProductLineEntity">
<summary>
名 称 :产线管理
@@ -1020,6 +1045,31 @@
产线描述
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.ProductLineStepsEntity">
<summary>
产线工序
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProductLineStepsEntity.Step">
<summary>
步骤
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProductLineStepsEntity.ProcessId">
<summary>
工艺Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProductLineStepsEntity.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.ProductLineStepsEntity.ProcessName">
<summary>
工艺名称
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.RecipeMaterialEntity">
<summary>
名 称 :配方物料信息
@@ -6094,6 +6144,194 @@
<param name="id"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessDto">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 :2023/8/21 10:20:37
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessDto.Name">
<summary>
工艺流程名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessDto.ProcessType">
<summary>
流程类型
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessDto.Des">
<summary>
备注
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessUpdateInput">
<summary>
更新
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessDelInput">
<summary>
删除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessQueryInput">
<summary>
不分页
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessQueryPageInput">
<summary>
分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessQueryPageInput.Name">
<summary>
工艺流程名称
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProcessOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.IProcessService">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/8/21 10:30:26
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.Add(BPA.MES.Base.Application.Services.ProcessAddInput)">
<summary>
增加
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.Del(BPA.MES.Base.Application.Services.ProcessDelInput)">
<summary>
移除
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.Update(BPA.MES.Base.Application.Services.ProcessUpdateInput)">
<summary>
更新
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.List(BPA.MES.Base.Application.Services.ProcessQueryInput)">
<summary>
不分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.PagedList(BPA.MES.Base.Application.Services.ProcessQueryPageInput)">
<summary>
分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.Detail(System.String)">
<summary>
查询单条
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProcessService.SelectList">
<summary>
下拉列表
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProcessService">
<summary>
名 称 :报警日志
创 建 人 :yangxiao
创建时间 :2023/8/21 11:02:36
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.Add(BPA.MES.Base.Application.Services.ProcessAddInput)">
<summary>
增加
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.Del(BPA.MES.Base.Application.Services.ProcessDelInput)">
<summary>
删除
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.Detail(System.String)">
<summary>
详情
</summary>
<param name="Id"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.List(BPA.MES.Base.Application.Services.ProcessQueryInput)">
<summary>
列表
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.PagedList(BPA.MES.Base.Application.Services.ProcessQueryPageInput)">
<summary>
分页
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.Update(BPA.MES.Base.Application.Services.ProcessUpdateInput)">
<summary>
更新
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProcessService.SelectList">
<summary>
下拉
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.GroupInfoDto">
<summary>
名 称 :产品分组
@@ -6321,6 +6559,86 @@
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsDto">
<summary>
产线工艺步骤
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsDto.Step">
<summary>
步骤
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsDto.ProcessId">
<summary>
工艺Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsDto.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsDto.ProcessName">
<summary>
工艺名称
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsUpdateInput">
<summary>
更新
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsDelInput">
<summary>
删除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsQueryPageInput">
<summary>
分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsQueryPageInput.LineId">
<summary>
产线Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsQueryInput">
<summary>
不分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsQueryInput.LineId">
<summary>
产线Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStepsOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStepsOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStockDto">
<summary>
名 称 :
@@ -6629,6 +6947,56 @@
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.Add(BPA.MES.Base.Application.Services.ProductLineStepsAddInput)">
<summary>
增加
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.Del(BPA.MES.Base.Application.Services.ProductLineStepsDelInput)">
<summary>
移除
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.Update(BPA.MES.Base.Application.Services.ProductLineStepsUpdateInput)">
<summary>
更新
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.List(BPA.MES.Base.Application.Services.ProductLineStepsQueryInput)">
<summary>
不分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.SelectList">
<summary>
下拉列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.PagedList(BPA.MES.Base.Application.Services.ProductLineStepsQueryPageInput)">
<summary>
分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.Detail(System.String)">
<summary>
查询单条
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineStepsService.BatchUpdate(System.Collections.Generic.List{BPA.MES.Base.Application.Services.ProductLineStepsUpdateInput})">
<summary>
批量更新
</summary>
<param name="inputs"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineService">
<summary>
名 称 :产线服务
@@ -6737,6 +7105,64 @@
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.Add(BPA.MES.Base.Application.Services.ProductLineStepsAddInput)">
<summary>
增加
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.Del(BPA.MES.Base.Application.Services.ProductLineStepsDelInput)">
<summary>
删除
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.Detail(System.String)">
<summary>
详情
</summary>
<param name="Id"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.List(BPA.MES.Base.Application.Services.ProductLineStepsQueryInput)">
<summary>
列表
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.PagedList(BPA.MES.Base.Application.Services.ProductLineStepsQueryPageInput)">
<summary>
分页
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.SelectList">
<summary>
下拉
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.Update(BPA.MES.Base.Application.Services.ProductLineStepsUpdateInput)">
<summary>
更新
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.ProductLineStepsService.BatchUpdate(System.Collections.Generic.List{BPA.MES.Base.Application.Services.ProductLineStepsUpdateInput})">
<summary>
批量更新
</summary>
<param name="inputs"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialDto">
<summary>
名 称 :配方物料Dto类


+ 26
- 0
backend/BPA.MES.Base.Application/Entitys/Base/ProcessEntity.cs 파일 보기

@@ -0,0 +1,26 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 工艺流程库
/// </summary>
[SugarTable("process")]
public class ProcessEntity:DEntityBase
{
/// <summary>
/// 工艺流程名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 流程类型
/// </summary>
public string ProcessType { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Des { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}

+ 26
- 0
backend/BPA.MES.Base.Application/Entitys/Base/ProductLineStepsEntity.cs 파일 보기

@@ -0,0 +1,26 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 产线工序
/// </summary>
[SugarTable("product_line_steps")]
public class ProductLineStepsEntity : DEntityBase
{
/// <summary>
/// 步骤
/// </summary>
public int Step { get; set; }
/// <summary>
/// 工艺Id
/// </summary>
public string ProcessId { get; set; }
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 工艺名称
/// </summary>
public string ProcessName { get; set; }
}
}

+ 84
- 0
backend/BPA.MES.Base.Application/Services/ProcessEntity/Dtos/ProcessDto.cs 파일 보기

@@ -0,0 +1,84 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 :2023/8/21 10:20:37
/// 描 述 :
/// </summary>
public class ProcessDto
{
/// <summary>
/// 工艺流程名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 流程类型
/// </summary>
public string ProcessType { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Des { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get;set; }

}
/// <summary>
/// 增加
/// </summary>
public class ProcessAddInput : ProcessDto
{

}
/// <summary>
/// 更新
/// </summary>
public class ProcessUpdateInput : ProcessDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 删除
/// </summary>
public class ProcessDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 不分页
/// </summary>
public class ProcessQueryInput
{
}
/// <summary>
/// 分页
/// </summary>
public class ProcessQueryPageInput : RequestPage
{
/// <summary>
/// 工艺流程名称
/// </summary>
public string Name { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class ProcessOutput : ProcessDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
}

+ 48
- 0
backend/BPA.MES.Base.Application/Services/ProcessEntity/Services/IProcessService.cs 파일 보기

@@ -0,0 +1,48 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/21 10:30:26
/// 描 述 :
/// </summary>
public interface IProcessService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(ProcessAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(ProcessDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(ProcessUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<ProcessOutput>> List(ProcessQueryInput input);
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<ProcessOutput>> PagedList(ProcessQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<ProcessOutput> Detail(string Id);
/// <summary>
/// 下拉列表
/// </summary>
/// <returns></returns>
Task<dynamic> SelectList();
}
}

+ 110
- 0
backend/BPA.MES.Base.Application/Services/ProcessEntity/Services/ProcessService.cs 파일 보기

@@ -0,0 +1,110 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :报警日志
/// 创 建 人 :yangxiao
/// 创建时间 :2023/8/21 11:02:36
/// 描 述 :
/// </summary>
[ApiDescriptionSettings("工艺流程", Name = "Process", Tag = "工艺流程", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class ProcessService : IProcessService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public ProcessService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(ProcessAddInput input)
{
ProcessEntity entity = input.Adapt<ProcessEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(ProcessDelInput input)
{
var res = await _dbContext.Deleteable<ProcessEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<ProcessOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<ProcessEntity>().FirstAsync(x => x.Id == Id);
ProcessOutput output = entity.Adapt<ProcessOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<List<ProcessOutput>> List(ProcessQueryInput input)
{
var entity = await _dbContext.Queryable<ProcessEntity>().ToListAsync();
List<ProcessOutput> output = entity.Adapt<List<ProcessOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<ProcessOutput>> PagedList(ProcessQueryPageInput input)
{
var entity = await _dbContext.Queryable<ProcessEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name))
.OrderByDescending(x=>x.CreateTime)
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<ProcessOutput> output = entity.Adapt<SqlSugarPagedList<ProcessOutput>>();
return output;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(ProcessUpdateInput input)
{
var entity = await _dbContext.Queryable<ProcessEntity>().Where(x => x.Id == input.Id).FirstAsync();
entity = input.Adapt<ProcessEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<ProcessEntity>().Select(x => new
{
key = x.Id,
value = x.Name
}).ToListAsync();
return entity;
}
}
}

+ 94
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStepsDto.cs 파일 보기

@@ -0,0 +1,94 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 产线工艺步骤
/// </summary>
public class ProductLineStepsDto
{
/// <summary>
/// 步骤
/// </summary>
public int Step { get; set; }
/// <summary>
/// 工艺Id
/// </summary>
public string ProcessId { get; set; }
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 工艺名称
/// </summary>
public string ProcessName { get; set; }

}
/// <summary>
/// 增加
/// </summary>
public class ProductLineStepsAddInput : ProductLineStepsDto
{

}
/// <summary>
/// 更新
/// </summary>
public class ProductLineStepsUpdateInput : ProductLineStepsDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 删除
/// </summary>
public class ProductLineStepsDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class ProductLineStepsQueryPageInput : RequestPage
{
///// <summary>
///// 名称
///// </summary>
//public string Name { get; set; }
///// <summary>
///// 编码
///// </summary>
//public string Code { get; set; }
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
}

/// <summary>
/// 不分页
/// </summary>
public class ProductLineStepsQueryInput
{
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
}

/// <summary>
/// 输出
/// </summary>
public class ProductLineStepsOutput : ProductLineStepsDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}

}

+ 48
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineStepsService.cs 파일 보기

@@ -0,0 +1,48 @@
namespace BPA.MES.Base.Application.Services
{
public interface IProductLineStepsService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(ProductLineStepsAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(ProductLineStepsDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(ProductLineStepsUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<ProductLineStepsOutput>> List(ProductLineStepsQueryInput input);
/// <summary>
/// 下拉列表
/// </summary>
/// <returns></returns>
Task<dynamic> SelectList();
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<ProductLineStepsOutput>> PagedList(ProductLineStepsQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<ProductLineStepsOutput> Detail(string Id);
/// <summary>
/// 批量更新
/// </summary>
/// <param name="inputs"></param>
/// <returns></returns>
Task<bool> BatchUpdate(List<ProductLineStepsUpdateInput> inputs);
}
}

+ 133
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineStepsService.cs 파일 보기

@@ -0,0 +1,133 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.MES.Base.Application.Services
{
[ApiDescriptionSettings("产线工艺管理", Order = 0, Name = "ProductLineSteps", Tag = "产线服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class ProductLineStepsService : IProductLineStepsService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public ProductLineStepsService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(ProductLineStepsAddInput input)
{
//ProductLineStepsEntity entity = await _dbContext.Queryable<ProductLineStepsEntity>().FirstAsync(x => x.Name == input.Name);
//if (entity != null)
//{
// throw Oops.Bah("名称已存在!");
//}
//ProductLineStepsEntity entity = input.Adapt<ProductLineStepsEntity>();
//return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();

var step = await _dbContext.Queryable<ProductLineStepsEntity>().Where(x => x.LineId==input.LineId).MaxAsync(x => x.Step);
ProductLineStepsEntity entity = input.Adapt<ProductLineStepsEntity>();
entity.Step = step+1;
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(ProductLineStepsDelInput input)
{
var res = await _dbContext.Deleteable<ProductLineStepsEntity>().Where(x => x.Id==input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<ProductLineStepsOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<ProductLineStepsEntity>().FirstAsync();
ProductLineStepsOutput output = entity.Adapt<ProductLineStepsOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost, AllowAnonymous]
public async Task<List<ProductLineStepsOutput>> List(ProductLineStepsQueryInput input)
{
var entity = await _dbContext.Queryable<ProductLineStepsEntity>().WhereIF(!string.IsNullOrEmpty(input.LineId),x=>x.LineId==input.LineId).OrderBy(x => x.Step).ToListAsync();
List<ProductLineStepsOutput> output = entity.Adapt<List<ProductLineStepsOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<ProductLineStepsOutput>> PagedList(ProductLineStepsQueryPageInput input)
{
var entity = await _dbContext.Queryable<ProductLineStepsEntity>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<ProductLineStepsOutput> output = entity.Adapt<SqlSugarPagedList<ProductLineStepsOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<ProductLineStepsEntity>().Select(x => new
{
key = x.Id,
value = x.ProcessName
}).ToListAsync();
return entity;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(ProductLineStepsUpdateInput input)
{
//var entity = await _dbContext.Queryable<ProductLineStepsEntity>().FirstAsync(x => x.Id != input.Id && x.Name == input.Name);
//if (entity != null)
//{
// throw Oops.Bah("名称已存在!");
//}
var entity = input.Adapt<ProductLineStepsEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 批量更新
/// </summary>
/// <param name="inputs"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> BatchUpdate(List<ProductLineStepsUpdateInput> inputs)
{
List<ProductLineStepsEntity> entity = inputs.Adapt<List<ProductLineStepsEntity>>();
var res = await _dbContext.Updateable(entity).ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 1
- 1
backend/BPA.MES.Base.Web.Entry/appsettings.json 파일 보기

@@ -10,7 +10,7 @@
"AllowedHosts": "*",
"ConnectionConfigs": [
{
"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=BapAdmin123456.;",
"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_final_mes;Uid=root;Pwd=BapAdmin123456.;",
//"ConnectionString": "server=192.168.1.231;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=pztj8127;",
"DbType": "MySql",
"IsAutoCloseConnection": true


불러오는 중...
취소
저장