bug
This commit is contained in:
@@ -5,11 +5,13 @@ using JNPF.Common.Security;
|
|||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
|
using JNPF.Logging;
|
||||||
using JNPF.Message.Service;
|
using JNPF.Message.Service;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using JNPF.TaskScheduler;
|
using JNPF.TaskScheduler;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData;
|
using Tnb.BasicData;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
@@ -50,6 +52,8 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
if (input == null || input.IsEmpty())
|
if (input == null || input.IsEmpty())
|
||||||
throw Oops.Bah("参数不能为空");
|
throw Oops.Bah("参数不能为空");
|
||||||
|
|
||||||
|
Log.Information($"生产工单接收参数:{JsonConvert.SerializeObject(input)}");
|
||||||
|
|
||||||
List<PrdMo> moList = new List<PrdMo>();
|
List<PrdMo> moList = new List<PrdMo>();
|
||||||
List<ErpExtendField> extendFieldList = new List<ErpExtendField>();
|
List<ErpExtendField> extendFieldList = new List<ErpExtendField>();
|
||||||
@@ -82,6 +86,12 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
if(!units.Contains(item.unit_id))
|
if(!units.Contains(item.unit_id))
|
||||||
throw Oops.Bah($"{basMaterial.name}不存在{item.unit_id}该单位");
|
throw Oops.Bah($"{basMaterial.name}不存在{item.unit_id}该单位");
|
||||||
|
|
||||||
|
if (!await _db.Queryable<BasEbomH>().AnyAsync(x => x.material_id == basMaterial.id && x.version == item.ebom_version))
|
||||||
|
{
|
||||||
|
throw Oops.Bah($"系统中无法找到物料清单{item.ebom_version}版本");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
item.id = SnowflakeIdHelper.NextId();
|
item.id = SnowflakeIdHelper.NextId();
|
||||||
item.mo_source = "1";
|
item.mo_source = "1";
|
||||||
|
|||||||
@@ -412,10 +412,10 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
foreach (var item in input.details)
|
foreach (var item in input.details)
|
||||||
{
|
{
|
||||||
if (!inputMaterials.Contains(item.material_id))
|
// if (!inputMaterials.Contains(item.material_id))
|
||||||
{
|
// {
|
||||||
throw new Exception("该物料不是生产bom投入物料,不能签收");
|
// throw new Exception("该物料不是生产bom投入物料,不能签收");
|
||||||
}
|
// }
|
||||||
|
|
||||||
PrdMaterialReceiptD? detail = null;
|
PrdMaterialReceiptD? detail = null;
|
||||||
if (carry.carrystd_id == WmsWareHouseConst.CARRY_ZYXCSTD_ID || carry.carrystd_id == WmsWareHouseConst.CARRY_ZYLJSTD_ID)
|
if (carry.carrystd_id == WmsWareHouseConst.CARRY_ZYXCSTD_ID || carry.carrystd_id == WmsWareHouseConst.CARRY_ZYLJSTD_ID)
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ namespace Tnb.ProductionMgr
|
|||||||
eqp_type_code = SqlFunc.Subqueryable<EqpEquipType>().Where(iit => iit.id == b.equip_type_id).Select(iit => iit.name),
|
eqp_type_code = SqlFunc.Subqueryable<EqpEquipType>().Where(iit => iit.id == b.equip_type_id).Select(iit => iit.name),
|
||||||
eqp_machine_num = b.eqp_machine_num,
|
eqp_machine_num = b.eqp_machine_num,
|
||||||
tonnage = b.tonnage,
|
tonnage = b.tonnage,
|
||||||
task_list_qty = SqlFunc.Subqueryable<PrdMoTask>().Where(x => x.eqp_id == b.id && (x.mo_task_status==DictConst.ToBeStartedEnCode || x.mo_task_status==DictConst.ToBeScheduledEncode)).Count(),
|
task_list_qty = SqlFunc.Subqueryable<PrdMoTask>().Where(x => x.eqp_id == b.id && (x.mo_task_status==DictConst.ToBeStartedEnCode || x.mo_task_status==DictConst.ToBeScheduledEncode || x.mo_task_status==DictConst.InProgressEnCode || x.mo_task_status==DictConst.MoStatusPauseCode)).Count(),
|
||||||
estimated_end_date = SqlFunc.Subqueryable<PrdMoTask>().Where(x => x.eqp_id == b.id && (x.mo_task_status==DictConst.ToBeStartedEnCode || x.mo_task_status==DictConst.ToBeScheduledEncode)).Max(x=>x.create_time)
|
estimated_end_date = SqlFunc.Subqueryable<PrdMoTask>().Where(x => x.eqp_id == b.id && (x.mo_task_status==DictConst.ToBeStartedEnCode || x.mo_task_status==DictConst.ToBeScheduledEncode || x.mo_task_status==DictConst.InProgressEnCode || x.mo_task_status==DictConst.MoStatusPauseCode)).Max(x=>x.create_time)
|
||||||
}).Mapper(x =>
|
}).Mapper(x =>
|
||||||
{
|
{
|
||||||
x.first_date = x.estimated_end_date.HasValue ? x.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
|
x.first_date = x.estimated_end_date.HasValue ? x.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
|
||||||
|
|||||||
Reference in New Issue
Block a user