工单对象中 去掉了两个字段 增加了工单状态
This commit is contained in:
@@ -39,7 +39,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
[HttpGet("getworkorderListwithoutschedule")]
|
||||
public IActionResult GetWorkorderListWithoutSchedule(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
(List<ProWorkorder>, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, "0");
|
||||
(List<ProWorkorder>, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, 0);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
[HttpGet("getworkorderListwithschedule")]
|
||||
public IActionResult GetWorkorderListWithSchedule(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
(List<ProWorkorder>, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, "1");
|
||||
(List<ProWorkorder>, int) data = proWorkorderService.GetWorkorderList(pageNum, pageSize, year, week, date, 1);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
@@ -200,7 +200,8 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
{
|
||||
if(item.Id.Equals(workorderId)) // 找到当前工单ID的对象
|
||||
{
|
||||
if(!string.IsNullOrEmpty(item.Isarrange)) isArrange = item.Isarrange;
|
||||
//if(!string.IsNullOrEmpty(item.Wrokerorder_status)) isArrange = item.Isarrange;
|
||||
isArrange = item.Wrokerorder_status.ToString();
|
||||
currentWorkorder = item;
|
||||
break;
|
||||
}
|
||||
@@ -268,10 +269,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
string isArrange = "0";
|
||||
|
||||
// 排产状态非空
|
||||
if (!string.IsNullOrEmpty(lstWorkorder[0].Isarrange))
|
||||
{
|
||||
isArrange = lstWorkorder[0].Isarrange;
|
||||
}
|
||||
isArrange = lstWorkorder[0].Wrokerorder_status.ToString();
|
||||
|
||||
// 排产状态为 0 ,可执行删除
|
||||
if ("0".Equals(isArrange))
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qu
|
||||
[HttpGet("getworkorderList")]
|
||||
public IActionResult GetWorkorderList(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
(List<ProWorkorder>, int) data = quRoughService.GetWorkorderList(pageNum, pageSize, year, week, date, "1");
|
||||
(List<ProWorkorder>, int) data = quRoughService.GetWorkorderList(pageNum, pageSize, year, week, date, 1);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
@@ -40,16 +40,10 @@ namespace ZR.Model.mes.pro
|
||||
public int? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否已经生产
|
||||
/// 工单状态
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "isproduction")]
|
||||
public string Isproduction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否已经排程
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "isarrange")]
|
||||
public string Isarrange { get; set; }
|
||||
[SugarColumn(ColumnName = "wrokerorder_status")]
|
||||
public int Wrokerorder_status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace ZR.Service.mes.pro.IService
|
||||
{
|
||||
public interface IProWorkorderService
|
||||
{
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week,int date,string isSchedule);
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week,int date, int isSchedule);
|
||||
|
||||
public int SetWorkorderSechedule(string id, DateTime arrange_starttime, DateTime arrange_endtime);
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace ZR.Service.mes.pro
|
||||
public class ProWorkorderService : BaseService<ProWorkorder>, IProWorkorderService
|
||||
{
|
||||
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule)
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule)
|
||||
{
|
||||
|
||||
var predicate = Expressionable.Create<ProWorkorder>()
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(date > 0, it => it.Date == date)
|
||||
.And(it => it.Isarrange.Equals(isSchedule))
|
||||
.And(it => it.Wrokerorder_status.Equals(isSchedule))
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
@@ -53,7 +53,7 @@ namespace ZR.Service.mes.pro
|
||||
|
||||
TimeSpan productionTime = arrange_endtime - arrange_starttime;
|
||||
return Context.Updateable<ProWorkorder>()
|
||||
.SetColumns(it => new ProWorkorder() { ArrangeStarttime = arrange_starttime, ArrangeEndtime = arrange_endtime, Isarrange = "1", ProductionTime = (decimal)productionTime.TotalMinutes,Order=(int) CacheHelper.GetCache("workorder_id_max"),Isproduction="0" })
|
||||
.SetColumns(it => new ProWorkorder() { ArrangeStarttime = arrange_starttime, ArrangeEndtime = arrange_endtime, Wrokerorder_status = 1, ProductionTime = (decimal)productionTime.TotalMinutes,Order=(int) CacheHelper.GetCache("workorder_id_max") })
|
||||
.Where(it => it.Id.Equals(id))
|
||||
.ExecuteCommand();
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace ZR.Service.mes.pro
|
||||
public int ResetWorkorderSechedule(string id)
|
||||
{
|
||||
return Context.Updateable<ProWorkorder>()
|
||||
.SetColumns(it => it.Isarrange == "0")
|
||||
.SetColumns(it => it.Wrokerorder_status == 0)
|
||||
.SetColumns(it => it.Order == 0)
|
||||
.Where(it => it.Id.Equals(id))
|
||||
.ExecuteCommand();
|
||||
@@ -78,7 +78,7 @@ namespace ZR.Service.mes.pro
|
||||
public int ReleaseProduction(string id)
|
||||
{
|
||||
return Context.Updateable<ProWorkorder>()
|
||||
.SetColumns(it => it.Isproduction == "1")
|
||||
.SetColumns(it => it.Wrokerorder_status == 1)
|
||||
.Where(it => it.Id.Equals(id))
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ namespace ZR.Service.mes.qu.IService
|
||||
{
|
||||
public interface IQuRoughService
|
||||
{
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule);
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace ZR.Service.mes.qu
|
||||
public class QuRoughService : BaseService<QuRough>, IQuRoughService
|
||||
{
|
||||
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, string isSchedule)
|
||||
public (List<ProWorkorder>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProWorkorder>()
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(date > 0, it => it.Date == date)
|
||||
.AndIF(date > 0, it => it.Isarrange.Equals(isSchedule))
|
||||
.AndIF(date > 0, it => it.Wrokerorder_status==isSchedule)
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user