工序表接口
This commit is contained in:
parent
7eb89f1a7e
commit
492e3ac2ba
@ -0,0 +1,126 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Service.MES.process.IService;
|
||||
using DOAN.Model.MES.process;
|
||||
using DOAN.Model.MES.process.Dto;
|
||||
using DOAN.Service.Business;
|
||||
|
||||
//创建时间:2025-09-20
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 工序表
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/process/ProcessmodelOperation")]
|
||||
public class ProcessmodelOperationController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 工序表接口
|
||||
/// </summary>
|
||||
private readonly IProcessmodelOperationService _ProcessmodelOperationService;
|
||||
|
||||
public ProcessmodelOperationController(IProcessmodelOperationService ProcessmodelOperationService)
|
||||
{
|
||||
_ProcessmodelOperationService = ProcessmodelOperationService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工艺路线父子表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list_parent")]
|
||||
[ActionPermissionFilter(Permission = "process:processmodelrouting:list")]
|
||||
public IActionResult QueryProcessmodelRouting([FromQuery] ProcessmodelRoutingQueryDto parm)
|
||||
{
|
||||
var response = _ProcessmodelOperationService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工序表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "process:processmodeloperation:list")]
|
||||
public IActionResult QueryProcessmodelOperation([FromQuery] ProcessmodelOperationQueryDto parm)
|
||||
{
|
||||
var response = _ProcessmodelOperationService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工序表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "process:processmodeloperation:query")]
|
||||
public IActionResult GetProcessmodelOperation(int Id)
|
||||
{
|
||||
var response = _ProcessmodelOperationService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<ProcessmodelOperation>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加工序表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "process:processmodeloperation:add")]
|
||||
[Log(Title = "工序表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddProcessmodelOperation([FromBody] ProcessmodelOperationDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProcessmodelOperation>().ToCreate(HttpContext);
|
||||
|
||||
var response = _ProcessmodelOperationService.AddProcessmodelOperation(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新工序表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "process:processmodeloperation:edit")]
|
||||
[Log(Title = "工序表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateProcessmodelOperation([FromBody] ProcessmodelOperationDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProcessmodelOperation>().ToUpdate(HttpContext);
|
||||
var response = _ProcessmodelOperationService.UpdateProcessmodelOperation(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除工序表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "process:processmodeloperation:delete")]
|
||||
[Log(Title = "工序表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteProcessmodelOperation(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _ProcessmodelOperationService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,10 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.Business;
|
||||
using DOAN.Service.Business.IBusinessService;
|
||||
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Service.MES.process.IService;
|
||||
using DOAN.Model.MES.process;
|
||||
using DOAN.Model.MES.process.Dto;
|
||||
|
||||
//创建时间:2025-09-19
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
|
||||
55
DOAN.Model/MES/process/Dto/ProcessmodelOperationDto.cs
Normal file
55
DOAN.Model/MES/process/Dto/ProcessmodelOperationDto.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.process.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 工序表查询对象
|
||||
/// </summary>
|
||||
public class ProcessmodelOperationQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工序表输入输出对象
|
||||
/// </summary>
|
||||
public class ProcessmodelOperationDto
|
||||
{
|
||||
[Required(ErrorMessage = "主键ID不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工序编码不能为空")]
|
||||
public string OperationCode { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工序名称不能为空")]
|
||||
public string OperationName { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "所属工艺路线ID不能为空")]
|
||||
public int RoutingId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工序顺序号不能为空")]
|
||||
public int OperationSeq { get; set; }
|
||||
|
||||
public string WorkCenter { get; set; }
|
||||
|
||||
public decimal StandardTime { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "创建时间不能为空")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "是否有效:1=有效,0=无效不能为空")]
|
||||
public string IsActive { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ProcessmodelRouteParentDto :ProcessmodelRouting
|
||||
{
|
||||
public int parentId { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.Dto
|
||||
namespace DOAN.Model.MES.process.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线表查询对象
|
||||
|
||||
76
DOAN.Model/MES/process/ProcessmodelOperation.cs
Normal file
76
DOAN.Model/MES/process/ProcessmodelOperation.cs
Normal file
@ -0,0 +1,76 @@
|
||||
|
||||
namespace DOAN.Model.MES.process
|
||||
{
|
||||
/// <summary>
|
||||
/// 工序表
|
||||
/// </summary>
|
||||
[SugarTable("processmodel_operation")]
|
||||
public class ProcessmodelOperation
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operation_code")]
|
||||
public string OperationCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operation_name")]
|
||||
public string OperationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属工艺路线ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "routing_id")]
|
||||
public int RoutingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序顺序号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operation_seq")]
|
||||
public int OperationSeq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作中心/设备/车间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "work_center")]
|
||||
public string WorkCenter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准工时(单位:分钟)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "standard_time")]
|
||||
public decimal StandardTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序描述
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "update_time")]
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有效:1=有效,0=无效
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "is_active")]
|
||||
public string IsActive { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
namespace DOAN.Model.Business
|
||||
namespace DOAN.Model.MES.process
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线表
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using System.Collections.Generic;
|
||||
using DOAN.Model.MES.process.Dto;
|
||||
using DOAN.Model.MES.process;
|
||||
using Aliyun.OSS;
|
||||
|
||||
namespace DOAN.Service.MES.process.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 工序表service接口
|
||||
/// </summary>
|
||||
public interface IProcessmodelOperationService : IBaseService<ProcessmodelOperation>
|
||||
{
|
||||
List<ProcessmodelRouteParentDto> GetList(ProcessmodelRoutingQueryDto parm);
|
||||
PagedInfo<ProcessmodelOperationDto> GetList(ProcessmodelOperationQueryDto parm);
|
||||
|
||||
ProcessmodelOperation GetInfo(int Id);
|
||||
|
||||
ProcessmodelOperation AddProcessmodelOperation(ProcessmodelOperation parm);
|
||||
|
||||
int UpdateProcessmodelOperation(ProcessmodelOperation parm);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.Business;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DOAN.Service.Business.IBusinessService
|
||||
using System.Collections.Generic;
|
||||
using DOAN.Model.MES.process.Dto;
|
||||
using DOAN.Model.MES.process;
|
||||
|
||||
namespace DOAN.Service.MES.process.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线表service接口
|
||||
|
||||
114
DOAN.Service/MES/process/ProcessmodelOperationService.cs
Normal file
114
DOAN.Service/MES/process/ProcessmodelOperationService.cs
Normal file
@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
|
||||
using DOAN.Repository;
|
||||
|
||||
using System.Linq;
|
||||
using DOAN.Model.MES.process.Dto;
|
||||
using DOAN.Service.MES.process.IService;
|
||||
using DOAN.Model.MES.process;
|
||||
|
||||
namespace DOAN.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 工序表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProcessmodelOperationService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProcessmodelOperationService : BaseService<ProcessmodelOperation>, IProcessmodelOperationService
|
||||
{
|
||||
|
||||
public List<ProcessmodelRouteParentDto> GetList(ProcessmodelRoutingQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProcessmodelRouting>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.RoutingCode), p => parm.RoutingCode.Contains(p.RoutingCode))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.RoutingName), p => parm.RoutingName.Contains(p.RoutingName))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Version), p => parm.Version.Contains(p.Version));
|
||||
|
||||
var response = Context.Queryable<ProcessmodelRouting>()
|
||||
.Where(predicate.ToExpression())
|
||||
.Select(p => new ProcessmodelRouteParentDto()
|
||||
{
|
||||
RoutingCode = p.RoutingCode,
|
||||
RoutingName = p.RoutingName,
|
||||
Version = p.Version,
|
||||
ProductCode = p.ProductCode,
|
||||
Description = p.Description,
|
||||
parentId = 0
|
||||
|
||||
});
|
||||
return response.ToList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工序表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<ProcessmodelOperationDto> GetList(ProcessmodelOperationQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProcessmodelOperation>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<ProcessmodelOperation, ProcessmodelOperationDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public ProcessmodelOperation GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加工序表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public ProcessmodelOperation AddProcessmodelOperation(ProcessmodelOperation model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改工序表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateProcessmodelOperation(ProcessmodelOperation model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new ProcessmodelOperation()
|
||||
//{
|
||||
// OperationCode = model.OperationCode,
|
||||
// OperationName = model.OperationName,
|
||||
// OperationSeq = model.OperationSeq,
|
||||
// WorkCenter = model.WorkCenter,
|
||||
// StandardTime = model.StandardTime,
|
||||
// Description = model.Description,
|
||||
// UpdateTime = model.UpdateTime,
|
||||
// IsActive = model.IsActive,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -4,10 +4,13 @@ using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.Business;
|
||||
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.Business.IBusinessService;
|
||||
using System.Linq;
|
||||
using DOAN.Service.MES.process.IService;
|
||||
using DOAN.Model.MES.process;
|
||||
using DOAN.Model.MES.process.Dto;
|
||||
|
||||
namespace DOAN.Service.Business
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user