This commit is contained in:
2024-09-30 15:53:10 +08:00
5 changed files with 23 additions and 6 deletions

View File

@@ -29,5 +29,14 @@ namespace Tnb.ProductionMgr.Entities.Dto
/// 物料型号
/// </summary>
public string? f_flowid { get; set; }
/// <summary>
/// 已报工数量
/// </summary>
public decimal? reported_work_qty { get; set; } = 0;
/// <summary>
/// 报废数量
/// </summary>
public decimal? scrap_qty { get; set; } = 0;
}
}

View File

@@ -260,4 +260,9 @@ public partial class PrdMoTask : BaseEntity<string>
/// 按产量更换批次次数
/// </summary>
public int change_batch_count_by_qty { get; set; } = -2;
/// <summary>
/// 是否手动设置批号
/// </summary>
public int is_hand_set_batch { get; set; } = 0;
}

View File

@@ -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<PrdMo>()
.LeftJoin<BasMaterial>((aa, bb) => aa.material_id == bb.id)
.LeftJoin<DictionaryTypeEntity>((aa, bb, cc) => cc.EnCode == DictConst.MeasurementUnit)

View File

@@ -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<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.CHANGEBATCHNUM);
BasFactoryConfig changeBatchDay = await _db.Queryable<BasFactoryConfig>().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<ToolMolds>().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<PrdMoTask>()
.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<PrdMoTask>().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<BasMaterial>().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}";

View File

@@ -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,