自动生产提报
This commit is contained in:
@@ -28,6 +28,9 @@ using Tnb.BasicData;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.WarehouseMgr;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -42,6 +45,7 @@ namespace Tnb.ProductionMgr
|
||||
private readonly RedisData _redisData;
|
||||
private readonly IWmsEmptyOutstockService _wmsEmptyOutstockService;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IPrdMoTaskService _prdMoTaskService;
|
||||
|
||||
public TimeWorkService(
|
||||
RedisData redisData,
|
||||
@@ -49,6 +53,7 @@ namespace Tnb.ProductionMgr
|
||||
IBillRullService billRullService,
|
||||
IOrganizeService organizeService,
|
||||
IWmsEmptyOutstockService wmsEmptyOutstockService,
|
||||
IPrdMoTaskService prdMoTaskService,
|
||||
IWareHouseService wareHouseService
|
||||
)
|
||||
{
|
||||
@@ -59,6 +64,7 @@ namespace Tnb.ProductionMgr
|
||||
_billRullService = billRullService;
|
||||
_wmsEmptyOutstockService = wmsEmptyOutstockService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_prdMoTaskService = prdMoTaskService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
@@ -333,6 +339,32 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<String> AutoPrdReport()
|
||||
{
|
||||
string carryCode = await _redisData.TryGetValueByKeyField<string>("外包装箱码垛线", "WBZX_x1_take_tp");
|
||||
int num = await _redisData.TryGetValueByKeyField<int>("外包装箱码垛线", "WBZX_x1_Enquantity");
|
||||
if (string.IsNullOrEmpty(carryCode) || num<=0)
|
||||
{
|
||||
return "无载具或数量为0";
|
||||
}
|
||||
PrdMoTask prdMoTask = await _db.Queryable<PrdMoTask>().Where(x => x.workline_id == WmsWareHouseConst.XUELUGUAN1XIAN && x.mo_task_status == DictConst.InProgressEnCode && x.parent_id == null).FirstAsync();
|
||||
if (prdMoTask == null)
|
||||
{
|
||||
return "血路管1线没有进行中的任务单";
|
||||
}
|
||||
|
||||
PrdReportCrInput input = new PrdReportCrInput();
|
||||
input.mo_task_code = prdMoTask.mo_task_code;
|
||||
input.mo_task_id = prdMoTask.id;
|
||||
input.reported_qty = num;
|
||||
input.station = "";
|
||||
input.material_box_code = carryCode;
|
||||
await _prdMoTaskService.PrdReport(input);
|
||||
return "true";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user