pad 报工
This commit is contained in:
parent
a5d70cac29
commit
c3444a2a74
@ -64,6 +64,7 @@ public class WorkOrderProgressController : BaseController
|
||||
var response = workorderProgressService.GetWorkOrderListNoFinish(today, line_code, group_code);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
//TODO 获取全部工单
|
||||
//TODO 根据班组 ,产线 和日期获取all工单
|
||||
[HttpGet("get_workorder_list")]
|
||||
@ -167,6 +168,22 @@ public class WorkOrderProgressController : BaseController
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
//TODO 无需防错就报工
|
||||
/// <summary>
|
||||
/// 无需防错就报工
|
||||
/// </summary>
|
||||
/// <param name="wokorder">工单</param>
|
||||
/// <param name="reportNum">报工数</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("no_errorProofingAndReportingReport")]
|
||||
public IActionResult NoErrorProofingAndReportingReport(string workorder,int reportNum)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workorder) || reportNum<=0)
|
||||
throw new CustomException("workorder或者报工数为0");
|
||||
var response = workorderProgressService.NoErrorProofingAndReportingReport(workorder, reportNum);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO 完成 工单
|
||||
/// </summary>
|
||||
@ -216,7 +233,4 @@ public class WorkOrderProgressController : BaseController
|
||||
var response = workorderProgressService.GetWorkOrderScanCodeInfo(workorder);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -35,6 +35,8 @@ namespace DOAN.Service.JobKanban.IService
|
||||
|
||||
int ErrorProofingAndReportingWork(string workorder, string labelContext);
|
||||
|
||||
int NoErrorProofingAndReportingReport(string wokorder, int reportNum);
|
||||
|
||||
int FinishWorkorder(string workorder, int finish_num);
|
||||
|
||||
(int ,int) GetWorkOrderProgress(string workorder);
|
||||
|
||||
@ -32,6 +32,7 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
|
||||
.Where(it => it.WorkorderDate == handleDate)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public List<ProReportwork> GetReportWorkRecord(string group_code, string line_code, DateTime handleDate)
|
||||
{
|
||||
|
||||
@ -248,6 +249,55 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
|
||||
}
|
||||
|
||||
|
||||
public int NoErrorProofingAndReportingReport(string wokorder, int reportNum)
|
||||
{
|
||||
int result = 0;
|
||||
var checked_workorder = Context.Queryable<ProReportwork>().Where(it => it.FkWorkorder == wokorder)
|
||||
.Any();
|
||||
if (checked_workorder)
|
||||
{
|
||||
//修改
|
||||
result = Context.Updateable<ProReportwork>().Where(it => it.FkWorkorder == wokorder)
|
||||
.SetColumns(it => it.FinishedNum == reportNum)
|
||||
.SetColumns(it=>it.UpdatedTime==DateTime.Now)
|
||||
.SetColumns(it=>it.UpdatedBy=="PDA")
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// 新增
|
||||
|
||||
var selected_workorder = Context.Queryable<ProWorkorder>().Where(it => it.Workorder == wokorder)
|
||||
.First();
|
||||
if (selected_workorder != null)
|
||||
{
|
||||
var reportWork = new ProReportwork();
|
||||
reportWork.Id = XueHua;
|
||||
reportWork.FkWorkorder = wokorder;
|
||||
reportWork.DispatchNum = selected_workorder.DeliveryNum;
|
||||
reportWork.FinishedNum = reportNum;
|
||||
reportWork.GroupCode = selected_workorder.GroupCode;
|
||||
reportWork.LineCode = selected_workorder.LineCode;
|
||||
reportWork.CreatedTime = DateTime.Now;
|
||||
reportWork.CreatedBy = "kanban";
|
||||
reportWork.UpdatedBy = "kanban";
|
||||
reportWork.UpdatedTime = DateTime.Now;
|
||||
result= Context.Insertable(reportWork).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int FinishWorkorder(string workorder, int finish_num)
|
||||
{
|
||||
var result = 0;
|
||||
@ -283,6 +333,13 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
|
||||
return tuple;
|
||||
}
|
||||
|
||||
|
||||
//查询工单下的扫描条码信息
|
||||
public List<ProReportworkDetail> GetWorkOrderScanCodeInfo(string workorder)
|
||||
{
|
||||
return Context.Queryable<ProReportworkDetail>().Where(it => it.Workorder == workorder).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据工单号 查询每个工单号进度
|
||||
/// </summary>
|
||||
@ -309,12 +366,4 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//查询工单下的扫描条码信息
|
||||
public List<ProReportworkDetail> GetWorkOrderScanCodeInfo(string workorder)
|
||||
{
|
||||
return Context.Queryable<ProReportworkDetail>().Where(it => it.Workorder == workorder).ToList();
|
||||
}
|
||||
}
|
||||
56
DOAN.Tasks/TaskScheduler/Job_MovSlow_Execute.cs
Normal file
56
DOAN.Tasks/TaskScheduler/Job_MovSlow_Execute.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Quartz;
|
||||
using Quartz.Impl.Triggers;
|
||||
using Quartz.Impl;
|
||||
using SqlSugar.IOC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DOAN.Model.System;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Service.MES.mm.IService;
|
||||
|
||||
namespace DOAN.Tasks.TaskScheduler
|
||||
{
|
||||
|
||||
[AppService(ServiceType = typeof(Job_MovSlow_Execute), ServiceLifetime = LifeTime.Scoped)]
|
||||
public class Job_MovSlow_Execute : JobBase, IJob
|
||||
{
|
||||
private readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
private readonly IMmSlowMoveMaterialService MmSlowMoveMaterialService;
|
||||
|
||||
public Job_MovSlow_Execute(IMmSlowMoveMaterialService MmSlowMoveMaterialService)
|
||||
{
|
||||
this.MmSlowMoveMaterialService = MmSlowMoveMaterialService;
|
||||
}
|
||||
|
||||
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
await ExecuteJob(context, async () => await Run(context));
|
||||
}
|
||||
|
||||
public async Task Run(IJobExecutionContext context)
|
||||
{
|
||||
AbstractTrigger trigger = (context as JobExecutionContextImpl).Trigger as AbstractTrigger;
|
||||
//var info = await tasksQzService.CopyNew().GetByIdAsync(trigger.JobName);
|
||||
// CopyNew 在多线程环境中,为每个线程或任务创建新的 SugarScope 实例以避免线程安全问题
|
||||
var info = await DbScoped.SugarScope.CopyNew().Queryable<SysTasks>().FirstAsync(f => f.ID == trigger.JobName);
|
||||
if (info == null)
|
||||
{
|
||||
throw new CustomException($"任务{trigger?.JobName}呆滞品任务调度请求执行失败,任务不存在");
|
||||
}
|
||||
|
||||
bool result = MmSlowMoveMaterialService.GenerateShopFloorSluggishProducts(DateTime.Today, "任务调度");
|
||||
logger.Info($"(job)任务【{info.Name}】设备管理调度请求执行结果=" + result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user