diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs index 1fa0547f..87e3d769 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs @@ -29,5 +29,14 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 物料型号 /// public string? f_flowid { get; set; } + /// + /// 已报工数量 + /// + public decimal? reported_work_qty { get; set; } = 0; + + /// + /// 报废数量 + /// + public decimal? scrap_qty { get; set; } = 0; } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs index 8e7b533a..9efa7256 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs @@ -260,4 +260,9 @@ public partial class PrdMoTask : BaseEntity /// 按产量更换批次次数 /// public int change_batch_count_by_qty { get; set; } = -2; + + /// + /// 是否手动设置批号 + /// + public int is_hand_set_batch { get; set; } = 0; } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs index c61fd85f..17c74d16 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs @@ -170,6 +170,8 @@ namespace Tnb.ProductionMgr remark = a.remark, f_flowtaskid = b.material_specification, f_flowid = b.material_standard, + reported_work_qty = a.reported_work_qty, + scrap_qty = a.scrap_qty, children = SqlFunc.Subqueryable() .LeftJoin((aa, bb) => aa.material_id == bb.id) .LeftJoin((aa, bb, cc) => cc.EnCode == DictConst.MeasurementUnit) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 1a60c653..e8822939 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -2046,7 +2046,7 @@ namespace Tnb.ProductionMgr bool changeBatchFlag = false; int changeCountNumByDay = 0; int changeCountNumByQty = 0; - if (mo.mo_type == DictConst.PrdMoTypeZS || mo.mo_type == DictConst.PrdMoTypeJC) + if (prdMoTask.is_hand_set_batch==0 && (mo.mo_type == DictConst.PrdMoTypeZS || mo.mo_type == DictConst.PrdMoTypeJC)) { BasFactoryConfig changeBatchNum = await _db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.CHANGEBATCHNUM); BasFactoryConfig changeBatchDay = await _db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.CHANGEBATCHDAY); @@ -2071,7 +2071,7 @@ namespace Tnb.ProductionMgr } - if (mo.mo_type == DictConst.PrdMoTypeZS) + if (mo.mo_type == DictConst.PrdMoTypeZS && prdMoTask.is_hand_set_batch==0) { if (changeBatchFlag) { @@ -2090,7 +2090,7 @@ namespace Tnb.ProductionMgr } - }else if (mo.mo_type == DictConst.PrdMoTypeJC) + }else if (mo.mo_type == DictConst.PrdMoTypeJC && prdMoTask.is_hand_set_batch==0) { ToolMolds toolMolds = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); batch = $"6{toolMolds.mold_code.Substring(toolMolds.mold_code.Length - 4, 2)}{DateTime.Now.ToString("yyMMdd")}"; @@ -4130,12 +4130,13 @@ namespace Tnb.ProductionMgr string batch = input.GetOrDefault("batch"); int row = await _db.Updateable() .SetColumns(x => x.batch == batch) + .SetColumns(x => x.is_hand_set_batch == 1) .Where(x => idList.Contains(x.id)) .ExecuteCommandAsync(); foreach (var id in idList) { PrdMoTask prdMoTask = await _db.Queryable().Where(x => x.id == id).SingleAsync(); - if (prdMoTask.mo_task_status == DictConst.InProgressEnCode) + if (prdMoTask.mo_task_status == DictConst.InProgressEnCode && prdMoTask.schedule_type==2) { BasMaterial basMaterial = await _db.Queryable().Where(x=>x.id==prdMoTask.material_id).SingleAsync(); string code1 = $"(01){basMaterial.di ?? ""}*(11){prdMoTask.act_start_date.Value.ToString("yyMMdd")}*(17){prdMoTask.first_start_date.Value.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}*(10){batch}"; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsRawmatOutstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsRawmatOutstockService.cs index 72433d9f..9a1d331c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsRawmatOutstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsRawmatOutstockService.cs @@ -171,8 +171,8 @@ namespace Tnb.WarehouseMgr ["corpvid"] = erpOrg.corpvid, ["crowno"] = wmsRawmatOutstockD.lineno, ["cunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit_id || x.Id==item.unit_id)?.Id ?? ""))?.cunitid ?? "", - ["cvendorid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_id ?? "", - ["cvendorvid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_vid ?? "", + ["cvendorid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_id, + ["cvendorvid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_vid, ["dbizdate"] = wmsRawmatOutstockH.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"), ["nshouldnum"] = item.codeqty, ["nnum"] = item.codeqty,