测试 SortSchedule
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using JinianNet.JNTemplate;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Model.mes.pro;
|
||||
@@ -21,7 +25,15 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
this.proWorkorderService = proWorkorderService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有非排产工单
|
||||
/// </summary>
|
||||
/// <param name="pageNum"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="week"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getworkorderListwithoutschedule")]
|
||||
public IActionResult GetWorkorderListWithoutSchedule(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
@@ -30,6 +42,15 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有排产工单
|
||||
/// </summary>
|
||||
/// <param name="pageNum"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="week"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getworkorderListwithschedule")]
|
||||
public IActionResult GetWorkorderListWithSchedule(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
@@ -37,5 +58,75 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据工单ID,设置为排产状态
|
||||
/// </summary>
|
||||
/// <param name="id">工单ID</param>
|
||||
/// <param name="arrange_starttime">预计开始时间</param>
|
||||
/// <param name="arrange_endtime">预计结束时间</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("setschedule")]
|
||||
public IActionResult SetSchedule(string id, string arrange_starttime,string arrange_endtime)
|
||||
{
|
||||
DateTime bgDateTime = DateTime.Now;
|
||||
DateTime edDateTime = DateTime.Now;
|
||||
try
|
||||
{
|
||||
bgDateTime = Convert.ToDateTime(arrange_starttime);
|
||||
edDateTime = Convert.ToDateTime(arrange_endtime);
|
||||
}
|
||||
catch { }
|
||||
|
||||
int data = proWorkorderService.SetWorkorderSechedule(id, bgDateTime, edDateTime);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据工单ID,设置为非排产状态
|
||||
/// </summary>
|
||||
/// <param name="id">工单ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("resetschedule")]
|
||||
public IActionResult ResetSchedule(string id)
|
||||
{
|
||||
|
||||
int data = proWorkorderService.ResetWorkorderSechedule(id);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("sortschedule")]
|
||||
public IActionResult SortSchedule([FromBody] List<t> parameter)
|
||||
{
|
||||
|
||||
//JsonElement t = (JsonElement)parameter;
|
||||
//JsonElement.
|
||||
//parameter.Adapt(t);
|
||||
//string t = parameter["listKeyValue"];
|
||||
//Dictionary<string, string> KV_ID_Sort = new Dictionary<string, string>();
|
||||
|
||||
|
||||
//JArray ja = (JArray)JsonConvert.DeserializeObject(t);
|
||||
//foreach (JToken item in ja.ToList())
|
||||
//{
|
||||
// KV_ID_Sort.Add(item["id"].ToString(), item["value"].ToString());
|
||||
//}
|
||||
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", 1));
|
||||
}
|
||||
}
|
||||
|
||||
public class t
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string order { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user