132 lines
4.3 KiB
C#
132 lines
4.3 KiB
C#
using DOAN.Admin.WebApi.Filters;
|
|
using DOAN.Model.MES.product;
|
|
using DOAN.Model.MES.product.Dto;
|
|
using DOAN.Service.Mobile;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using DOAN.Service.Mobile.IService;
|
|
using DOAN.Model.Mobile.Dto;
|
|
using DOAN.Service.MES.product.IService;
|
|
using Infrastructure.Converter;
|
|
|
|
namespace DOAN.Admin.Mobile.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 移动端 报工
|
|
/// </summary>
|
|
|
|
[Route("mes/Mobile/ReportWork")]
|
|
public class PADReportWorkController : BaseController
|
|
{
|
|
/// <summary>
|
|
/// 报工表接口
|
|
/// </summary>
|
|
private readonly IPADReportWorkService padReportWorkService;
|
|
|
|
public PADReportWorkController(IPADReportWorkService padReportWorkService)
|
|
{
|
|
this.padReportWorkService = padReportWorkService;
|
|
}
|
|
|
|
|
|
//TODO 无需防错就报工
|
|
/// <summary>
|
|
/// 无需防错就报工
|
|
/// </summary>
|
|
/// <param name="wokorder">工单</param>
|
|
/// <param name="reportNum">报工数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("no_errorProofingAndReportingReport")]
|
|
public IActionResult NoErrorProofingAndReportingReport(string workorder,int reportNum)
|
|
{
|
|
if (string.IsNullOrEmpty(workorder))
|
|
throw new CustomException("workorder或者报工数为0");
|
|
var response = padReportWorkService.NoErrorProofingAndReportingReport(workorder, reportNum);
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
|
|
//TODO 获取全部工艺路线
|
|
[HttpGet("get_all_route")]
|
|
public IActionResult GetAllRoute()
|
|
{
|
|
var response = padReportWorkService.GetAllRoute();
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
//TODO 获取全部组
|
|
[HttpGet("get_groups")]
|
|
public IActionResult GetGroupList()
|
|
{
|
|
var response = padReportWorkService.GetGroupList();
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
|
|
//获取工单列表PDA
|
|
//TODO 获取不同状态的工单 (PDA用)
|
|
//TODO 根据班组,日期
|
|
[HttpGet("get_workorder_status_list")]
|
|
public IActionResult GetWorkOrderStatusList(string group_code,int status, DateTime handleDate)
|
|
{
|
|
handleDate=DOANConvertDateTime.ConvertLocalDate(handleDate);
|
|
if (string.IsNullOrEmpty(group_code) || handleDate == DateTime.MinValue)
|
|
throw new CustomException("传入空值异常");
|
|
|
|
var response = padReportWorkService.GetWorkOrderStatusList(group_code, status, handleDate);
|
|
|
|
return SUCCESS(response);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新报工表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPut]
|
|
|
|
[Log(Title = "报工表", BusinessType = BusinessType.UPDATE)]
|
|
public IActionResult UpdateProReportwork([FromBody] ProReportworkDto parm)
|
|
{
|
|
var modal = parm.Adapt<ProReportwork>().ToUpdate(HttpContext);
|
|
var response = padReportWorkService.UpdateProReportwork(modal);
|
|
|
|
return ToResponse(response);
|
|
}
|
|
|
|
//TODO 获取工单详情
|
|
// 获取工单详情
|
|
[HttpGet("get_workorder_detail")]
|
|
public IActionResult GetWorkOrderDetail(string workorder)
|
|
{
|
|
if (string.IsNullOrEmpty(workorder)) return SUCCESS(null);
|
|
var response = padReportWorkService.GetWorkOrderDetail(workorder);
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
|
|
//TODO 开始某个工单
|
|
[HttpGet("start_workorder")]
|
|
public async Task<IActionResult> StartWorkOrder(string workorder)
|
|
{
|
|
if (string.IsNullOrEmpty(workorder)) return SUCCESS(null);
|
|
var response =await padReportWorkService.StartWorkOrder(workorder);
|
|
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
//TODO 完成某一个工单
|
|
[HttpGet("finish_workorder")]
|
|
public IActionResult FinishWorkOrder(string workorder)
|
|
{
|
|
if (string.IsNullOrEmpty(workorder)) return SUCCESS(null);
|
|
var response = padReportWorkService.FinishWorkOrder(workorder);
|
|
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
|
|
// TODO 如果没有id 传入工单 手动生成报工记录 沿用之前路由 /mes/productManagement/ProReportwork/manual_generation_reportwork
|
|
}
|
|
}
|
|
|