注塑挤出批号设置
This commit is contained in:
@@ -29,5 +29,14 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
|||||||
/// 物料型号
|
/// 物料型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? f_flowid { get; set; }
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -260,4 +260,9 @@ public partial class PrdMoTask : BaseEntity<string>
|
|||||||
/// 按产量更换批次次数
|
/// 按产量更换批次次数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int change_batch_count_by_qty { get; set; } = -2;
|
public int change_batch_count_by_qty { get; set; } = -2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否手动设置批号
|
||||||
|
/// </summary>
|
||||||
|
public int is_hand_set_batch { get; set; } = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,8 @@ namespace Tnb.ProductionMgr
|
|||||||
remark = a.remark,
|
remark = a.remark,
|
||||||
f_flowtaskid = b.material_specification,
|
f_flowtaskid = b.material_specification,
|
||||||
f_flowid = b.material_standard,
|
f_flowid = b.material_standard,
|
||||||
|
reported_work_qty = a.reported_work_qty,
|
||||||
|
scrap_qty = a.scrap_qty,
|
||||||
children = SqlFunc.Subqueryable<PrdMo>()
|
children = SqlFunc.Subqueryable<PrdMo>()
|
||||||
.LeftJoin<BasMaterial>((aa, bb) => aa.material_id == bb.id)
|
.LeftJoin<BasMaterial>((aa, bb) => aa.material_id == bb.id)
|
||||||
.LeftJoin<DictionaryTypeEntity>((aa, bb, cc) => cc.EnCode == DictConst.MeasurementUnit)
|
.LeftJoin<DictionaryTypeEntity>((aa, bb, cc) => cc.EnCode == DictConst.MeasurementUnit)
|
||||||
|
|||||||
@@ -2046,7 +2046,7 @@ namespace Tnb.ProductionMgr
|
|||||||
bool changeBatchFlag = false;
|
bool changeBatchFlag = false;
|
||||||
int changeCountNumByDay = 0;
|
int changeCountNumByDay = 0;
|
||||||
int changeCountNumByQty = 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 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);
|
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)
|
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);
|
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")}";
|
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");
|
string batch = input.GetOrDefault("batch");
|
||||||
int row = await _db.Updateable<PrdMoTask>()
|
int row = await _db.Updateable<PrdMoTask>()
|
||||||
.SetColumns(x => x.batch == batch)
|
.SetColumns(x => x.batch == batch)
|
||||||
|
.SetColumns(x => x.is_hand_set_batch == 1)
|
||||||
.Where(x => idList.Contains(x.id))
|
.Where(x => idList.Contains(x.id))
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
foreach (var id in idList)
|
foreach (var id in idList)
|
||||||
{
|
{
|
||||||
PrdMoTask prdMoTask = await _db.Queryable<PrdMoTask>().Where(x => x.id == id).SingleAsync();
|
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();
|
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}";
|
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}";
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
["corpvid"] = erpOrg.corpvid,
|
["corpvid"] = erpOrg.corpvid,
|
||||||
["crowno"] = wmsRawmatOutstockD.lineno,
|
["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 ?? "",
|
["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 ?? "",
|
["cvendorid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_id,
|
||||||
["cvendorvid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_vid ?? "",
|
["cvendorvid"] = erpExtendFields.Find((x=>x.table_id==item.auxprop_gys))?.supplier_vid,
|
||||||
["dbizdate"] = wmsRawmatOutstockH.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
["dbizdate"] = wmsRawmatOutstockH.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
["nshouldnum"] = item.codeqty,
|
["nshouldnum"] = item.codeqty,
|
||||||
["nnum"] = item.codeqty,
|
["nnum"] = item.codeqty,
|
||||||
|
|||||||
Reference in New Issue
Block a user