141 lines
4.2 KiB
C#
141 lines
4.2 KiB
C#
using DOAN.Model.MES.recipe;
|
||
using DOAN.Model.MES.recipe.Dto;
|
||
using DOAN.Service.MES.recipe.IService;
|
||
using DOAN.ServiceCore.Middleware;
|
||
using Infrastructure;
|
||
using Infrastructure.Attribute;
|
||
using Infrastructure.Controllers;
|
||
using Infrastructure.Enums;
|
||
using Mapster;
|
||
using MDM.Models.Flow;
|
||
using MDM.Models.Session;
|
||
using MDM.Services.Session.IService;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
namespace MDM.Controllers.Session
|
||
{
|
||
|
||
/// <summary>
|
||
/// 回会管理
|
||
/// </summary>
|
||
[Route("mes/session_managemer")]
|
||
[AllowAnonymous]
|
||
public class SessionManagerController : BaseController
|
||
{
|
||
|
||
/// <summary>
|
||
/// 会话管理接口
|
||
/// </summary>
|
||
private readonly ISessionManagerService _ISessionManagerService;
|
||
public SessionManagerController(ISessionManagerService ISessionManagerService)
|
||
{
|
||
_ISessionManagerService = ISessionManagerService;
|
||
}
|
||
|
||
|
||
//TODO 开工申请
|
||
/// <summary>
|
||
/// 开工申请
|
||
/// </summary>
|
||
/// <param name="ProcessCode">过程码</param>
|
||
/// <param name="WorkOrder">当前工单号</param>
|
||
/// <returns>1:开工成功 0:异常 -1:重复开工 -2 参数异常</returns>
|
||
[HttpGet("start_work_apply")]
|
||
public IActionResult StartWorkApply(string ProcessCode, string WorkOrder)
|
||
{
|
||
if (string.IsNullOrEmpty(ProcessCode) || string.IsNullOrEmpty(WorkOrder))
|
||
{
|
||
return SUCCESS(-2);
|
||
}
|
||
|
||
int result = _ISessionManagerService.StartWorkApply(ProcessCode, WorkOrder);
|
||
|
||
return SUCCESS(result);
|
||
}
|
||
|
||
|
||
//TODO 入站申请
|
||
|
||
/// <summary>
|
||
/// 入站申请
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet("in_station_apply")]
|
||
public IActionResult InStationApply(string OperationCode, string ProcessCode)
|
||
{
|
||
|
||
InStationApplyResult result = _ISessionManagerService.InStationApply(OperationCode, ProcessCode);
|
||
return SUCCESS(result);
|
||
}
|
||
|
||
//TODO 中间流程/工步下发
|
||
[HttpGet("middle_station_apply")]
|
||
public IActionResult MiddleStationApply(string OperationCode, string ProcessCode)
|
||
{
|
||
|
||
List<string> result = _ISessionManagerService.MiddleProcessFlowDistribution(OperationCode, ProcessCode);
|
||
return SUCCESS(result);
|
||
}
|
||
|
||
|
||
|
||
//TODO 出站申请
|
||
[HttpGet("out_station_apply")]
|
||
public IActionResult OutStationApply(string OperationCode, string ProcessCode)
|
||
{
|
||
|
||
OutStationApplyResult result = _ISessionManagerService.OutStationApply(OperationCode, ProcessCode);
|
||
return SUCCESS(result);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
//TODO 完工申请
|
||
/// <summary>
|
||
/// 完工申请
|
||
/// </summary>
|
||
/// <param name="ProcessCode">过程码</param>
|
||
/// <param name="WorkOrder">当前工单号</param>
|
||
/// <returns>1:开工成功 0:异常 -1:重复开工 -2 参数异常</returns>
|
||
[HttpGet("finish_work_apply")]
|
||
public IActionResult FinishWorkApply(string ProcessCode, string WorkOrder)
|
||
{
|
||
if (string.IsNullOrEmpty(ProcessCode) || string.IsNullOrEmpty(WorkOrder))
|
||
{
|
||
return SUCCESS(-2);
|
||
}
|
||
|
||
int result = _ISessionManagerService.FinishWorkApply(ProcessCode, WorkOrder);
|
||
|
||
return SUCCESS(result);
|
||
}
|
||
|
||
//TODO 返工申请
|
||
/// <summary>
|
||
/// 返工申请
|
||
/// </summary>
|
||
/// <param name="ProcessCode">过程码</param>
|
||
/// <param name="WorkOrder">当前工单号</param>
|
||
/// <returns>1:返工成功 0:异常 -1:重复开工 -2 参数异常</returns>
|
||
[HttpGet("rework_apply")]
|
||
public IActionResult ReWorkApply(string ProcessCode, string WorkOrder)
|
||
{
|
||
if (string.IsNullOrEmpty(ProcessCode) || string.IsNullOrEmpty(WorkOrder))
|
||
{
|
||
return SUCCESS(-2);
|
||
}
|
||
|
||
int result = _ISessionManagerService.ReWorkApply(ProcessCode, WorkOrder);
|
||
|
||
return SUCCESS(result);
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
}
|