ManualMaterialLoading.cs
3.08 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
using Hh.Mes.Pojo.System;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.EnumEntitys;
using Hh.Mes.POJO.Request;
using Hh.Mes.POJO.Response;
using Hh.Mes.Service.Distribution;
using Hh.Mes.Service.SystemAuth;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
namespace WebMvc.Areas.wo.Controllers
{
#region 人工装料
/// <summary>
/// 人工装料
/// </summary>
[Area("distribution")]
public class ManualMaterialLoadingController : BaseController
{
private readonly MaterialDistributeLoadDataService service;
public ManualMaterialLoadingController(IAuth authUtil, MaterialDistributeLoadDataService service) : base(authUtil)
{
this.service = service;
var user = authUtil.GetCurrentUser();
if (user != null)
{
this.service.sysWebUser = user.User;
}
}
#region 视图功能
public IActionResult Index()
{
return View();
}
#endregion
#region 获取数据
/// <summary>
/// 加载装料头数据
/// </summary>
[HttpPost]
public string LoadHead()
{
return Serialize(service.GteChargeAreaData("loadGroupCode"));
}
/// <summary>
/// 加载装料叫料点
/// </summary>
[HttpPost]
public string LoadData(string keys)
{
return Serialize(service.GetChargeData(keys));
}
/// <summary>
/// 料点对应装料点查询
/// </summary>
[HttpPost]
public string GetLocationRelData(string locationCode)
{
return Serialize(service.GetLocationRelData(locationCode));
}
#endregion
#region 提交数据
#endregion
#region 自定义方法
/// <summary>
/// 装料操作
/// </summary>
[HttpPost]
public string LoadingCharge(bus_material_distribute_load model, int askingStatus)
{
return Serialize(service.LoadingCharge(model, askingStatus));
}
#endregion
#region ECS交互
/// <summary>
/// 收取ECS发送过来的叫料请求
/// </summary>
[HttpPost]
public string ECSLoadingAsking([FromBody] RequestData<List<string>> requestData)
{
//初始化
service.IniLocationVm();
foreach (var item in requestData.Data)
{
var locationItem = SystemVariable.locationList.Where(x => x.locationCode == item).FirstOrDefault();
if (locationItem == null) continue;
if (locationItem.askingStatus == (int)EnumLocationAskingStatus.已装料)
{
service.InsAgvTask(item);
service.UpLocationVm(item, EnumLocationAskingStatus.已送料);
}
}
var response = new Response();
return Serialize(response);
}
#endregion
}
#endregion
}