首工序和末工序
This commit is contained in:
@@ -54,6 +54,17 @@ public class ReportFlowController : BaseController
|
||||
}
|
||||
return ToResponse(ResultCode.SUCCESS,_reportFlowService.GetProcessReportWorkDetail(workorder, processId));
|
||||
}
|
||||
//TODO 领料工序
|
||||
[HttpGet("feed_process_reportwork")]
|
||||
public IActionResult FeedProcessReportwork(string workorder, int processId, int finish_num,string stove_code,string feed_order)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workorder))
|
||||
{
|
||||
throw new CustomException("workorder or process is null");
|
||||
}
|
||||
|
||||
return SUCCESS(_reportFlowService.FeedProcessReportwork(workorder, processId, finish_num, stove_code, feed_order, HttpContext.GetNickName()));
|
||||
}
|
||||
|
||||
//TODO 工序报工
|
||||
/// <summary>
|
||||
@@ -75,7 +86,19 @@ public class ReportFlowController : BaseController
|
||||
|
||||
return SUCCESS(_reportFlowService.ProcessReportWork(workorder, processId, finish_num,bad_num,HttpContext.GetNickName()));
|
||||
}
|
||||
|
||||
|
||||
//TODO 出货工序
|
||||
[HttpGet("shipment_process_reportwork")]
|
||||
public IActionResult ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workorder))
|
||||
{
|
||||
throw new CustomException("workorder or process is null");
|
||||
}
|
||||
|
||||
return SUCCESS(_reportFlowService.ShipmentProcessReportwork(workorder, processId, finish_num, bad_num, customer_order, HttpContext.GetNickName()));
|
||||
}
|
||||
|
||||
//TODO 获取工单下的报工列表
|
||||
[HttpGet("get_workorder_reportwork_list")]
|
||||
public IActionResult GetWorkOrderReportWorkList(string workorder)
|
||||
|
||||
@@ -10,8 +10,11 @@ public interface IReportFlowService: IBaseService<ProReportwork01>
|
||||
|
||||
ProReportwork01 GetProcessReportWorkDetail(string workorder, int process);
|
||||
|
||||
bool FeedProcessReportwork(string workorder, int processId, int finish_num, string stove_code, string feed_order, string Worker);
|
||||
|
||||
bool ProcessReportWork(string workorder, int process, int finish_num,int bad_num,string Worker);
|
||||
|
||||
bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker);
|
||||
List<ProReportWorkDetialDto> GetWorkOrderReportWorkList(string workorder);
|
||||
|
||||
}
|
||||
@@ -6,6 +6,8 @@ using DOAN.Service.Mobile.IService;
|
||||
using DOAN.Service.Public.IPublicService;
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar.DistributedSystem.Snowflake;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace DOAN.Service.Mobile;
|
||||
|
||||
@@ -24,41 +26,138 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
||||
{
|
||||
return Context.Queryable<ProReportwork01>().Where(x => x.Workorder == workorder && x.ProcessId == process).First();
|
||||
}
|
||||
|
||||
public bool ProcessReportWork(string workorder, int process, int finish_num,int bad_num,string Worker)
|
||||
/// <summary>
|
||||
/// 首工序报工
|
||||
/// </summary>
|
||||
/// <param name="workorder"></param>
|
||||
/// <param name="processId"></param>
|
||||
/// <param name="finish_num"></param>
|
||||
/// <param name="stove_code"></param>
|
||||
/// <param name="feed_order"></param>
|
||||
/// <param name="Worker"></param>
|
||||
/// <returns></returns>
|
||||
public bool FeedProcessReportwork(string workorder, int processId, int finish_num, string stove_code, string feed_order, string Worker)
|
||||
{
|
||||
int result = 0;
|
||||
bool Exist= Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder&&it.ProcessId==process).Any();
|
||||
if (Exist)
|
||||
{
|
||||
result= Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == process)
|
||||
.SetColumns(it => it.FinishNum == finish_num)
|
||||
.SetColumns(it => it.BadNum == bad_num)
|
||||
.SetColumns(it => it.Worker == Worker)
|
||||
.SetColumns(it => it.JobDate == DateTime.Now)
|
||||
.SetColumns(it => it.UpdatedBy == Worker)
|
||||
.SetColumns(it => it.UpdatedTime == DateTime.Now)
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||
if (Exist)
|
||||
{
|
||||
result = Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId)
|
||||
.SetColumns(it => it.FinishNum == finish_num)
|
||||
.SetColumns(it => it.Worker == Worker)
|
||||
.SetColumns(it => it.JobDate == DateTime.Now)
|
||||
.SetColumns(it => it.UpdatedBy == Worker)
|
||||
.SetColumns(it => it.UpdatedTime == DateTime.Now)
|
||||
.ExecuteCommand();
|
||||
Context.Updateable<ProWorkorder>().Where(it => it.Workorder == workorder)
|
||||
.UpdateColumns(it => it.StoveCode == stove_code)
|
||||
.UpdateColumns(it => it.FeedOrder == feed_order)
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ProReportwork01 proReportwork01 = new ProReportwork01();
|
||||
proReportwork01.Id = XueHua;
|
||||
proReportwork01.Workorder = workorder;
|
||||
proReportwork01.ProcessId = processId;
|
||||
proReportwork01.FinishNum = finish_num;
|
||||
|
||||
proReportwork01.Worker = Worker;
|
||||
proReportwork01.JobDate = DateTime.Now;
|
||||
proReportwork01.CreatedBy = Worker;
|
||||
proReportwork01.CreatedTime = DateTime.Now;
|
||||
result = Context.Insertable(proReportwork01).ExecuteCommand();
|
||||
Context.Updateable<ProWorkorder>().Where(it => it.Workorder == workorder)
|
||||
.UpdateColumns(it => it.StoveCode == stove_code)
|
||||
.UpdateColumns(it => it.FeedOrder == feed_order)
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ProReportwork01 proReportwork01=new ProReportwork01();
|
||||
proReportwork01.Id = XueHua;
|
||||
proReportwork01.Workorder = workorder;
|
||||
proReportwork01.ProcessId = process;
|
||||
proReportwork01.FinishNum = finish_num;
|
||||
proReportwork01.BadNum = bad_num;
|
||||
proReportwork01.Worker = Worker;
|
||||
proReportwork01.JobDate = DateTime.Now;
|
||||
proReportwork01.CreatedBy = Worker;
|
||||
proReportwork01.CreatedTime = DateTime.Now;
|
||||
result= Context.Insertable(proReportwork01).ExecuteCommand();
|
||||
|
||||
}
|
||||
return result>0;
|
||||
}
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
public bool ProcessReportWork(string workorder, int process, int finish_num, int bad_num, string Worker)
|
||||
{
|
||||
int result = 0;
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == process).Any();
|
||||
if (Exist)
|
||||
{
|
||||
result = Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == process)
|
||||
.SetColumns(it => it.FinishNum == finish_num)
|
||||
.SetColumns(it => it.BadNum == bad_num)
|
||||
.SetColumns(it => it.Worker == Worker)
|
||||
.SetColumns(it => it.JobDate == DateTime.Now)
|
||||
.SetColumns(it => it.UpdatedBy == Worker)
|
||||
.SetColumns(it => it.UpdatedTime == DateTime.Now)
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ProReportwork01 proReportwork01 = new ProReportwork01();
|
||||
proReportwork01.Id = XueHua;
|
||||
proReportwork01.Workorder = workorder;
|
||||
proReportwork01.ProcessId = process;
|
||||
proReportwork01.FinishNum = finish_num;
|
||||
proReportwork01.BadNum = bad_num;
|
||||
proReportwork01.Worker = Worker;
|
||||
proReportwork01.JobDate = DateTime.Now;
|
||||
proReportwork01.CreatedBy = Worker;
|
||||
proReportwork01.CreatedTime = DateTime.Now;
|
||||
result = Context.Insertable(proReportwork01).ExecuteCommand();
|
||||
|
||||
}
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 出货工序报工
|
||||
/// </summary>
|
||||
/// <param name="workorder"></param>
|
||||
/// <param name="processId"></param>
|
||||
/// <param name="finish_num"></param>
|
||||
/// <param name="bad_num"></param>
|
||||
/// <param name="feed_order"></param>
|
||||
/// <param name="Worker"></param>
|
||||
/// <returns></returns>
|
||||
public bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker)
|
||||
{
|
||||
int result = 0;
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||
if (Exist)
|
||||
{
|
||||
result = Context.Updateable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId)
|
||||
.SetColumns(it => it.FinishNum == finish_num)
|
||||
.SetColumns(it => it.Worker == Worker)
|
||||
.SetColumns(it => it.JobDate == DateTime.Now)
|
||||
.SetColumns(it => it.UpdatedBy == Worker)
|
||||
.SetColumns(it => it.UpdatedTime == DateTime.Now)
|
||||
.ExecuteCommand();
|
||||
Context.Updateable<ProWorkorder>().Where(it => it.Workorder == workorder)
|
||||
.UpdateColumns(it => it.CustomerOrder == customer_order)
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ProReportwork01 proReportwork01 = new ProReportwork01();
|
||||
proReportwork01.Id = XueHua;
|
||||
proReportwork01.Workorder = workorder;
|
||||
proReportwork01.ProcessId = processId;
|
||||
proReportwork01.FinishNum = finish_num;
|
||||
proReportwork01.Worker = Worker;
|
||||
proReportwork01.JobDate = DateTime.Now;
|
||||
proReportwork01.CreatedBy = Worker;
|
||||
proReportwork01.CreatedTime = DateTime.Now;
|
||||
result = Context.Insertable(proReportwork01).ExecuteCommand();
|
||||
Context.Updateable<ProWorkorder>().Where(it => it.Workorder == workorder)
|
||||
.UpdateColumns(it => it.CustomerOrder == customer_order)
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
public List<ProReportWorkDetialDto> GetWorkOrderReportWorkList(string workorder)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user