234 lines
7.7 KiB
C#
Executable File
234 lines
7.7 KiB
C#
Executable File
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Newtonsoft.Json.Linq;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.IPadReport.IServices;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.IPadReport.Model;
|
|
using Opsoft.NetCore.O3App.Shared;
|
|
using Opsoft.NetCore.O3App.WebApi.Models;
|
|
|
|
namespace Opsoft.NetCore.O3App.WebApi.Controllers.IPadReport
|
|
{
|
|
/// <summary>
|
|
/// 汇报信息操作控制层
|
|
/// </summary>
|
|
[Authorize]
|
|
public class ReportProduceController : BaseApiController<ReportInfoLoadController>
|
|
{
|
|
//服务层变量
|
|
private readonly IReportProduceService _service;
|
|
public ReportProduceController(IMapper mapper, ILogger<ReportInfoLoadController> logger, IReportProduceService reportProduceService)
|
|
: base(mapper, logger)
|
|
{
|
|
_service = reportProduceService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 员工上岗/下岗
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> SubmitEmployee([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.SubmitEmployee(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 员工上岗/下岗
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<string>> SubmitEmployeeWeb([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.SubmitEmployeeWeb(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 绑定/解绑设备
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> SubmitEmquipment([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.SubmitEmquipment(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序开工
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessStart([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessStartServices(input);
|
|
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序开工(Web)
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<string>> ProcessStartWeb([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessStartServicesWeb(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序上下模
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessInputMould([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessInputMould(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序投料
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessInputMaterial([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessInputMaterialServices(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 安灯呼叫
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessWarningCall([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessWarningCallServices(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 安灯异常呼叫处理(Web)
|
|
/// </summary>
|
|
/// <param name="SData"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<string>> DoAbnormalCallWeb([FromBody] DoAbnormalCall SData)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.DoAbnormalCallWeb(SData);
|
|
}, SData);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序汇报前验证检验状态
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<BaseResponse<string>> CheckInspectionStatus([FromQuery] Dictionary<string, string> paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.CheckInspectionStatusServices(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序换型,工序调机,工序暂停
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessChangeState([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessChangeStateServices(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 完工注销
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessAllCancel([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessAllCancelServices(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 完工注销(Web)
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<string>> ProcessAllCancelWeb([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessAllCancelServicesWeb(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工序汇报
|
|
/// </summary>
|
|
/// <param name="paramaters"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<ProductionAct>> ProcessReport([FromBody] JObject paramaters)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await _service.ProcessReportServices(input);
|
|
}, paramaters);
|
|
}
|
|
|
|
[HttpGet]
|
|
public BaseResponse<string> GetComputerId()
|
|
{
|
|
return new BaseResponse<string>() { Data = Guid.NewGuid().ToString(), Message = "", Success = true, StatusCode = 200 };
|
|
}
|
|
|
|
}
|
|
}
|