点巡检 设备模具保养执行修改
This commit is contained in:
@@ -23,5 +23,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
|||||||
public DateTime? date_create_time { get; set; }
|
public DateTime? date_create_time { get; set; }
|
||||||
public DateTime? date_execute_time { get; set; }
|
public DateTime? date_execute_time { get; set; }
|
||||||
public DateTime? date_last_execute_time { get; set; }
|
public DateTime? date_last_execute_time { get; set; }
|
||||||
|
|
||||||
|
public DateTime? date_modify_time { get; set; }
|
||||||
|
|
||||||
|
public string modify_id { get; set; }
|
||||||
|
public string modify_id_id { get; set; }
|
||||||
|
|
||||||
|
public string modify_time { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,5 +19,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
|||||||
public DateTime? date_repeat_time { get; set; }
|
public DateTime? date_repeat_time { get; set; }
|
||||||
public DateTime? date_create_time { get; set; }
|
public DateTime? date_create_time { get; set; }
|
||||||
public DateTime? date_spot_record_date_time { get; set; }
|
public DateTime? date_spot_record_date_time { get; set; }
|
||||||
|
|
||||||
|
public DateTime? date_modify_time { get; set; }
|
||||||
|
|
||||||
|
public string modify_id { get; set; }
|
||||||
|
public string modify_id_id { get; set; }
|
||||||
|
|
||||||
|
public string modify_time { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,5 +23,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
|||||||
public DateTime? date_create_time { get; set; }
|
public DateTime? date_create_time { get; set; }
|
||||||
public DateTime? date_execute_time { get; set; }
|
public DateTime? date_execute_time { get; set; }
|
||||||
public DateTime? date_last_execute_time { get; set; }
|
public DateTime? date_last_execute_time { get; set; }
|
||||||
|
|
||||||
|
public DateTime? date_modify_time { get; set; }
|
||||||
|
|
||||||
|
public string modify_id { get; set; }
|
||||||
|
public string modify_id_id { get; set; }
|
||||||
|
|
||||||
|
public string modify_time { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ public partial class EqpEquipment : BaseEntity<string>
|
|||||||
public string? technology_parameter { get; set; }
|
public string? technology_parameter { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 状态
|
/// 状态 试验,待添加,生产,报废
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? status { get; set; }
|
public string? status { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -67,18 +67,19 @@ namespace Tnb.EquipMgr
|
|||||||
input.sidx = "a." + input.sidx;
|
input.sidx = "a." + input.sidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
SqlSugarPagedList<EqpMaintainRecordListOutput> list = await db.Queryable<EqpMaintainRecordH, EqpEquipment, UserEntity, UserEntity>((a, b, c, d) => new object[]
|
SqlSugarPagedList<EqpMaintainRecordListOutput> list = await db.Queryable<EqpMaintainRecordH, EqpEquipment, UserEntity, UserEntity,UserEntity>((a, b, c, d,e) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.equip_id == b.id,
|
JoinType.Left, a.equip_id == b.id,
|
||||||
JoinType.Left, a.execute_user_id == c.Id,
|
JoinType.Left, a.execute_user_id == c.Id,
|
||||||
JoinType.Left, a.repeat_user_id == d.Id,
|
JoinType.Left, a.repeat_user_id == d.Id,
|
||||||
|
JoinType.Left, a.modify_id == e.Id,
|
||||||
})
|
})
|
||||||
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status)
|
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status)
|
||||||
.WhereIF(!string.IsNullOrEmpty(equioInfo), (a, b, c) => b.code.Contains(equioInfo) || b.name.Contains(equioInfo))
|
.WhereIF(!string.IsNullOrEmpty(equioInfo), (a, b, c) => b.code.Contains(equioInfo) || b.name.Contains(equioInfo))
|
||||||
.WhereIF(status == "3" && start_time != null, a => a.execute_time >= start_time)
|
.WhereIF(status == "3" && start_time != null, a => a.execute_time >= start_time)
|
||||||
.WhereIF(status == "3" && end_time != null, a => a.execute_time <= end_time)
|
.WhereIF(status == "3" && end_time != null, a => a.execute_time <= end_time)
|
||||||
.OrderBy($"{input.sidx} {input.sort}")
|
.OrderBy($"{input.sidx} {input.sort}")
|
||||||
.Select((a, b, c, d) => new EqpMaintainRecordListOutput
|
.Select((a, b, c, d,e) => new EqpMaintainRecordListOutput
|
||||||
{
|
{
|
||||||
id = a.id,
|
id = a.id,
|
||||||
equip_id = b.code + "/" + b.name,
|
equip_id = b.code + "/" + b.name,
|
||||||
@@ -95,6 +96,9 @@ namespace Tnb.EquipMgr
|
|||||||
repeat_user_id_id = a.repeat_user_id,
|
repeat_user_id_id = a.repeat_user_id,
|
||||||
result_remark = a.result_remark,
|
result_remark = a.result_remark,
|
||||||
repeat_remark = a.repeat_remark,
|
repeat_remark = a.repeat_remark,
|
||||||
|
modify_id = e.RealName,
|
||||||
|
modify_id_id = e.Id,
|
||||||
|
date_modify_time = a.modify_time ,
|
||||||
date_last_execute_time = SqlFunc.Subqueryable<EqpMaintainRecordH>().Where(x => a.equip_id == x.equip_id && a.execute_time != null).OrderByDesc(x => x.execute_time).Select(x => x.execute_time)
|
date_last_execute_time = SqlFunc.Subqueryable<EqpMaintainRecordH>().Where(x => a.equip_id == x.equip_id && a.execute_time != null).OrderByDesc(x => x.execute_time).Select(x => x.execute_time)
|
||||||
})
|
})
|
||||||
.Mapper(a =>
|
.Mapper(a =>
|
||||||
@@ -104,6 +108,7 @@ namespace Tnb.EquipMgr
|
|||||||
a.execute_time = a.date_execute_time == null ? "" : a.date_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.execute_time = a.date_execute_time == null ? "" : a.date_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
a.last_execute_time = a.date_last_execute_time == null ? "" : a.date_last_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.last_execute_time = a.date_last_execute_time == null ? "" : a.date_last_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
a.modify_time = a.date_modify_time == null ? "" : a.date_modify_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
var EqpMaintainRecordHs = await db.Queryable<EqpMaintainRecordH>().Where(p => list.list.Select(p => p.equip_id_id).ToList().Contains(p.equip_id)).ToListAsync();
|
var EqpMaintainRecordHs = await db.Queryable<EqpMaintainRecordH>().Where(p => list.list.Select(p => p.equip_id_id).ToList().Contains(p.equip_id)).ToListAsync();
|
||||||
@@ -298,5 +303,28 @@ namespace Tnb.EquipMgr
|
|||||||
}).FirstAsync();
|
}).FirstAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<string> Assign(Dictionary<string, string> dic)
|
||||||
|
{
|
||||||
|
string id = dic["id"];
|
||||||
|
string executeUserId = dic["executeUserId"];
|
||||||
|
EqpMaintainRecordH eqpSpotInsRecordH = await _repository.GetSingleAsync(x => x.id == id);
|
||||||
|
if (eqpSpotInsRecordH.status == "1")
|
||||||
|
{
|
||||||
|
_ = await _repository.UpdateAsync(x => new EqpMaintainRecordH()
|
||||||
|
{
|
||||||
|
execute_user_id = executeUserId,
|
||||||
|
modify_id = _userManager.UserId,
|
||||||
|
modify_time = DateTime.Now
|
||||||
|
}, x => x.id == id);
|
||||||
|
return "指派成功";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw Oops.Bah("状态错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,11 +66,12 @@ namespace Tnb.EquipMgr
|
|||||||
input.sidx = "a." + input.sidx;
|
input.sidx = "a." + input.sidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
SqlSugarPagedList<EqpSpotInsRecordListOutput> list = await db.Queryable<EqpSpotInsRecordH, EqpEquipment, UserEntity, UserEntity>((a, b, c, d) => new object[]
|
SqlSugarPagedList<EqpSpotInsRecordListOutput> list = await db.Queryable<EqpSpotInsRecordH, EqpEquipment, UserEntity, UserEntity,UserEntity>((a, b, c, d,e) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.equip_id == b.id,
|
JoinType.Left, a.equip_id == b.id,
|
||||||
JoinType.Left, a.spot_record_user_id == c.Id,
|
JoinType.Left, a.spot_record_user_id == c.Id,
|
||||||
JoinType.Left, a.repeat_user_id == d.Id,
|
JoinType.Left, a.repeat_user_id == d.Id,
|
||||||
|
JoinType.Left, a.modify_id == e.Id,
|
||||||
})
|
})
|
||||||
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status)
|
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status)
|
||||||
.WhereIF(!string.IsNullOrEmpty(equioInfo), (a, b, c) => b.code.Contains(equioInfo) || b.name.Contains(equioInfo))
|
.WhereIF(!string.IsNullOrEmpty(equioInfo), (a, b, c) => b.code.Contains(equioInfo) || b.name.Contains(equioInfo))
|
||||||
@@ -78,7 +79,7 @@ namespace Tnb.EquipMgr
|
|||||||
.WhereIF(status == "3" && end_time != null, a => a.spot_record_date_time <= end_time)
|
.WhereIF(status == "3" && end_time != null, a => a.spot_record_date_time <= end_time)
|
||||||
.Where(a => a.create_time.Value.ToString("yyyy-MM-dd") == now)
|
.Where(a => a.create_time.Value.ToString("yyyy-MM-dd") == now)
|
||||||
.OrderBy($"{input.sidx} {input.sort}")
|
.OrderBy($"{input.sidx} {input.sort}")
|
||||||
.Select((a, b, c, d) => new EqpSpotInsRecordListOutput
|
.Select((a, b, c, d,e) => new EqpSpotInsRecordListOutput
|
||||||
{
|
{
|
||||||
id = a.id,
|
id = a.id,
|
||||||
equip_id = b.code + "/" + b.name,
|
equip_id = b.code + "/" + b.name,
|
||||||
@@ -93,6 +94,9 @@ namespace Tnb.EquipMgr
|
|||||||
spot_record_user_id_id = a.spot_record_user_id,
|
spot_record_user_id_id = a.spot_record_user_id,
|
||||||
repeat_user_id = d.RealName,
|
repeat_user_id = d.RealName,
|
||||||
repeat_user_id_id = a.repeat_user_id,
|
repeat_user_id_id = a.repeat_user_id,
|
||||||
|
modify_id = e.RealName,
|
||||||
|
modify_id_id = e.Id,
|
||||||
|
date_modify_time = a.modify_time ,
|
||||||
})
|
})
|
||||||
.Mapper(a =>
|
.Mapper(a =>
|
||||||
{
|
{
|
||||||
@@ -100,6 +104,7 @@ namespace Tnb.EquipMgr
|
|||||||
a.create_time = a.date_create_time == null ? "" : a.date_create_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.create_time = a.date_create_time == null ? "" : a.date_create_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
a.spot_record_date_time = a.date_spot_record_date_time == null ? "" : a.date_spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.spot_record_date_time = a.date_spot_record_date_time == null ? "" : a.date_spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
a.modify_time = a.date_modify_time == null ? "" : a.date_modify_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
|
|
||||||
@@ -253,5 +258,28 @@ namespace Tnb.EquipMgr
|
|||||||
}).FirstAsync();
|
}).FirstAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<string> Assign(Dictionary<string, string> dic)
|
||||||
|
{
|
||||||
|
string id = dic["id"];
|
||||||
|
string spotRecordUserId = dic["spotRecordUserId"];
|
||||||
|
EqpSpotInsRecordH eqpSpotInsRecordH = await _repository.GetSingleAsync(x => x.id == id);
|
||||||
|
if (eqpSpotInsRecordH.status == "1")
|
||||||
|
{
|
||||||
|
_ = await _repository.UpdateAsync(x => new EqpSpotInsRecordH()
|
||||||
|
{
|
||||||
|
spot_record_user_id = spotRecordUserId,
|
||||||
|
modify_id = _userManager.UserId,
|
||||||
|
modify_time = DateTime.Now
|
||||||
|
}, x => x.id == id);
|
||||||
|
return "指派成功";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw Oops.Bah("状态错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,18 +67,19 @@ namespace Tnb.EquipMgr
|
|||||||
input.sidx = "a." + input.sidx;
|
input.sidx = "a." + input.sidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
SqlSugarPagedList<ToolMoldMaintainRecordListOutput> list = await db.Queryable<ToolMoldMaintainRecordH, ToolMolds, UserEntity, UserEntity>((a, b, c, d) => new object[]
|
SqlSugarPagedList<ToolMoldMaintainRecordListOutput> list = await db.Queryable<ToolMoldMaintainRecordH, ToolMolds, UserEntity, UserEntity, UserEntity>((a, b, c, d,e) => new object[]
|
||||||
{
|
{
|
||||||
JoinType.Left, a.mold_id == b.id,
|
JoinType.Left, a.mold_id == b.id,
|
||||||
JoinType.Left, a.execute_user_id == c.Id,
|
JoinType.Left, a.execute_user_id == c.Id,
|
||||||
JoinType.Left, a.repeat_user_id == d.Id,
|
JoinType.Left, a.repeat_user_id == d.Id,
|
||||||
|
JoinType.Left, a.modify_id == e.Id,
|
||||||
})
|
})
|
||||||
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status)
|
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status)
|
||||||
.WhereIF(!string.IsNullOrEmpty(moldInfo), (a, b, c) => b.mold_code.Contains(moldInfo) || b.mold_name.Contains(moldInfo))
|
.WhereIF(!string.IsNullOrEmpty(moldInfo), (a, b, c) => b.mold_code.Contains(moldInfo) || b.mold_name.Contains(moldInfo))
|
||||||
.WhereIF(status == "3" && start_time != null, a => a.execute_time >= start_time)
|
.WhereIF(status == "3" && start_time != null, a => a.execute_time >= start_time)
|
||||||
.WhereIF(status == "3" && end_time != null, a => a.execute_time <= end_time)
|
.WhereIF(status == "3" && end_time != null, a => a.execute_time <= end_time)
|
||||||
.OrderBy($"{input.sidx} {input.sort}")
|
.OrderBy($"{input.sidx} {input.sort}")
|
||||||
.Select((a, b, c, d) => new ToolMoldMaintainRecordListOutput
|
.Select((a, b, c, d,e) => new ToolMoldMaintainRecordListOutput
|
||||||
{
|
{
|
||||||
id = a.id,
|
id = a.id,
|
||||||
mold_id = b.mold_code + "/" + b.mold_name,
|
mold_id = b.mold_code + "/" + b.mold_name,
|
||||||
@@ -95,7 +96,10 @@ namespace Tnb.EquipMgr
|
|||||||
repeat_user_id_id = a.repeat_user_id,
|
repeat_user_id_id = a.repeat_user_id,
|
||||||
result_remark = a.result_remark,
|
result_remark = a.result_remark,
|
||||||
repeat_remark = a.repeat_remark,
|
repeat_remark = a.repeat_remark,
|
||||||
date_last_execute_time = SqlFunc.Subqueryable<ToolMoldMaintainRecordH>().Where(x => a.mold_id == x.mold_id && a.execute_time != null).OrderByDesc(x => x.execute_time).Select(x => x.execute_time)
|
date_last_execute_time = SqlFunc.Subqueryable<ToolMoldMaintainRecordH>().Where(x => a.mold_id == x.mold_id && a.execute_time != null).OrderByDesc(x => x.execute_time).Select(x => x.execute_time),
|
||||||
|
modify_id = e.RealName,
|
||||||
|
modify_id_id = e.Id,
|
||||||
|
date_modify_time = a.modify_time ,
|
||||||
})
|
})
|
||||||
.Mapper(a =>
|
.Mapper(a =>
|
||||||
{
|
{
|
||||||
@@ -104,6 +108,7 @@ namespace Tnb.EquipMgr
|
|||||||
a.execute_time = a.date_execute_time == null ? "" : a.date_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.execute_time = a.date_execute_time == null ? "" : a.date_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
a.last_execute_time = a.date_last_execute_time == null ? "" : a.date_last_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
a.last_execute_time = a.date_last_execute_time == null ? "" : a.date_last_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
a.modify_time = a.date_modify_time == null ? "" : a.date_modify_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||||
var ToolMoldMaintainRecordHs = await db.Queryable<ToolMoldMaintainRecordH>().Where(p => list.list.Select(p => p.mold_id_id).ToList().Contains(p.mold_id)).ToListAsync();
|
var ToolMoldMaintainRecordHs = await db.Queryable<ToolMoldMaintainRecordH>().Where(p => list.list.Select(p => p.mold_id_id).ToList().Contains(p.mold_id)).ToListAsync();
|
||||||
@@ -300,5 +305,28 @@ namespace Tnb.EquipMgr
|
|||||||
}).FirstAsync();
|
}).FirstAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<string> Assign(Dictionary<string, string> dic)
|
||||||
|
{
|
||||||
|
string id = dic["id"];
|
||||||
|
string executeUserId = dic["executeUserId"];
|
||||||
|
ToolMoldMaintainRecordH eqpSpotInsRecordH = await _repository.GetSingleAsync(x => x.id == id);
|
||||||
|
if (eqpSpotInsRecordH.status == "1")
|
||||||
|
{
|
||||||
|
_ = await _repository.UpdateAsync(x => new ToolMoldMaintainRecordH()
|
||||||
|
{
|
||||||
|
execute_user_id = executeUserId,
|
||||||
|
modify_id = _userManager.UserId,
|
||||||
|
modify_time = DateTime.Now
|
||||||
|
}, x => x.id == id);
|
||||||
|
return "指派成功";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw Oops.Bah("状态错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,5 +34,19 @@
|
|||||||
/// 模具状态
|
/// 模具状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string mold_status { get; set; }
|
public string mold_status { get; set; }
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// /// 进度条
|
||||||
|
// /// </summary>
|
||||||
|
// public string progress_bar { get; set; }
|
||||||
|
|
||||||
|
public int? complete_qty { get; set; }
|
||||||
|
|
||||||
|
public int? scheduled_qty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 领用设备
|
||||||
|
/// </summary>
|
||||||
|
public string equip_name { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,8 +138,11 @@ namespace Tnb.ProductionMgr
|
|||||||
.InnerJoin<ToolMolds>((a, b) => a.mold_id == b.id)
|
.InnerJoin<ToolMolds>((a, b) => a.mold_id == b.id)
|
||||||
.InnerJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
.InnerJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
||||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d)=>d.Id==b.mold_status)
|
.LeftJoin<DictionaryDataEntity>((a,b,c,d)=>d.Id==b.mold_status)
|
||||||
|
.LeftJoin(_db.SqlQueryable<ToolMoldRequisition>("select * from tool_mold_requisition where id in (select max(id) from tool_mold_requisition group by mold_id)"),(a,b,c,d,e)=>b.id==e.mold_id)
|
||||||
|
.LeftJoin<EqpEquipment>((a,b,c,d,e,f)=>e.equip_id==f.id)
|
||||||
|
.LeftJoin<PrdMoTask>((a,b,c,d,e,f,g)=>e.mo_task_id==g.id)
|
||||||
.Where((a, b, c) => a.material_id == materialId)
|
.Where((a, b, c) => a.material_id == materialId)
|
||||||
.Select((a, b, c,d) => new Tnb.ProductionMgr.Entities.Dto.MoldListOutput
|
.Select((a, b, c,d,e,f,g) => new Tnb.ProductionMgr.Entities.Dto.MoldListOutput
|
||||||
{
|
{
|
||||||
mold_id = b.id,
|
mold_id = b.id,
|
||||||
mold_code = b.mold_code,
|
mold_code = b.mold_code,
|
||||||
@@ -149,6 +152,9 @@ namespace Tnb.ProductionMgr
|
|||||||
material_code = c.code,
|
material_code = c.code,
|
||||||
mold_status = d.FullName,
|
mold_status = d.FullName,
|
||||||
available_stations = SqlFunc.Subqueryable<EqpEquipment>().Where(it => it.mold_id == a.id).Count(),
|
available_stations = SqlFunc.Subqueryable<EqpEquipment>().Where(it => it.mold_id == a.id).Count(),
|
||||||
|
equip_name = f.name,
|
||||||
|
complete_qty = SqlFunc.IsNull(g.reported_work_qty, 0) + SqlFunc.IsNull(g.scrap_qty, 0),
|
||||||
|
scheduled_qty = SqlFunc.IsNull(g.scheduled_qty, 0)
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,12 +137,14 @@ namespace Tnb.ProductionMgr
|
|||||||
throw Oops.Bah($"{eqpEquipment.name}未设置原料条码数据采集项");
|
throw Oops.Bah($"{eqpEquipment.name}未设置原料条码数据采集项");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x => x.id == item.material_id);
|
||||||
|
|
||||||
Dictionary<string, string> dicCommand3 = new(StringComparer.OrdinalIgnoreCase)
|
Dictionary<string, string> dicCommand3 = new(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
["DevName"] = eqpDaq.equip_code,
|
["DevName"] = eqpDaq.equip_code,
|
||||||
["token"] = _eleCtlCfg.token,
|
["token"] = _eleCtlCfg.token,
|
||||||
["TagName"] = eqpDaq.label_name,
|
["TagName"] = eqpDaq.label_name,
|
||||||
["Value"] = item.material_id,
|
["Value"] = basMaterial?.code ?? "",
|
||||||
};
|
};
|
||||||
Log.Information($"注塑主控柜{eqpDaq.label_name}更新参数:{JsonConvert.SerializeObject(dicCommand3)}");
|
Log.Information($"注塑主控柜{eqpDaq.label_name}更新参数:{JsonConvert.SerializeObject(dicCommand3)}");
|
||||||
string responseresult3 =
|
string responseresult3 =
|
||||||
|
|||||||
Reference in New Issue
Block a user