UpstreamController.cs
1.86 KB
1
2
3
4
5
6
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using Hh.Mes.POJO.ApiEntity;
using Hh.Mes.POJO.EnumEntitys;
using Hh.Mes.POJO.Response;
using Hh.Mes.Service;
using Hh.Mes.Service.ApiService;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Hh.Mes.Api.Controllers
{
/// <summary>
/// 上游系统接口
/// ps:新增方法需要在SystemVariable 注册 APIList、EnumLog 新增枚举 ,方便接口日志定位查询
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class UpstreamController : BaseController
{
private readonly UpstreamService service;
//private readonly UserAuthSession sysUserApi;
public UpstreamController(UpstreamService service,IHttpContextAccessor accessor)
{
this.service = service;
context = accessor.HttpContext;
//this.sysUserApi = base.GetUser(context);
//this.service.sysUserApi = sysUserApi;
}
/// <summary>
/// 设备基础信息 HH_001
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[ActionName("Mes/V1/SendEquipment")]
public string SendEquipment(List<EquipmentEntity> entity)
{
return Serialize(service.SendEquipment(entity));
}
/// <summary>
/// 生产订单 MOM_HH_005
/// </summary>
[HttpPost]
[ActionName("Mes/V1/SendWorkOrder")]
public string SendWorkOrder(MomWorkOrder requestData)
{
return Serialize(service.SendWorkOrder(requestData));
}
/// <summary>
/// 获取MOM请求Token
/// </summary>
/// <returns></returns>
[HttpGet]
public string GetMomToken()
{
return Serialize(service.GetMomToken());
}
}
}