CutWeldController.cs 1.59 KB
using System;
using System.Collections.Generic;
using System.Linq;
using Hh.Mes.Api.Controllers;
using Hh.Mes.Common.Json;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.EnumEntitys;
using Hh.Mes.Service;
using Hh.Mes.Service.WebService.Planned;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Headers;
using Microsoft.AspNetCore.Mvc;

namespace Hh.Mes.Api.Controllers
{
    /// <summary>
    /// pda 查询接口
    /// ps:新增方法需要在SystemVariable 注册 APIList、EnumLog 新增枚举 ,方便接口日志定位查询
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CutWeldController : BaseController
    {
        private readonly CutWeldService service;
        public CutWeldController(CutWeldService cutWeldService, IHttpContextAccessor accessor)
        {
            service = cutWeldService;
            context = accessor.HttpContext;

            var sysUserApi = base.GetUser(context);
            this.service.sysUserApi = sysUserApi;
        }

        /// <summary>
        /// 供ECS调用,管段工序完工调用
        /// </summary>
        /// <param name="BarCode">追踪码</param>
        /// <param name="processesState">状态</param>
        /// <returns></returns>
        [HttpPost]
        [ActionName("Mes/V1/CutWeld/SendIWPTechnologylineProcess")]
        public string SendIWPTechnologylineProcess(string BarCode, int processesState)
        {
            service.SendIWPTechnologylineProcess(BarCode, processesState);

            return Serialize("ok");
        }
    }
}