Blame view

Hh.Mes.Api/Controllers/CutWeldController.cs 1.77 KB
高翔 authored
1
2
3
4
5
using System;
using System.Collections.Generic;
using System.Linq;
using Hh.Mes.Api.Controllers;
using Hh.Mes.Common.Json;
6
using Hh.Mes.Common.log;
高翔 authored
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 注册 APIListEnumLog 新增枚举 ,方便接口日志定位查询
    /// </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>
37
        /// PDA,ECS调用,任务号设备完工报工
高翔 authored
38
        /// </summary>
39
40
        /// <param name="taskCode">任务号</param>
        /// <param name="equipmentCode">设备编码</param>
高翔 authored
41
42
43
        /// <returns></returns>
        [HttpPost]
        [ActionName("Mes/V1/CutWeld/SendIWPTechnologylineProcess")]
44
        public string SendIWPTechnologylineProcess(string taskCode, string equipmentCode)
高翔 authored
45
        {
46
47
48
49
50
51
            return ExceptionsHelp.Instance.ExecuteT(() =>
            {
                CutWeldService cutService = new CutWeldService();
                cutService.SendTaskEnd(taskCode, equipmentCode);
                return Serialize("ok");
            });
高翔 authored
52
53
54
        }
    }
}