点巡检 设备模具保养执行修改
This commit is contained in:
@@ -23,5 +23,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
public DateTime? date_create_time { get; set; }
|
||||
public DateTime? date_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_create_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_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; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// 状态 试验,待添加,生产,报废
|
||||
/// </summary>
|
||||
public string? status { get; set; }
|
||||
|
||||
|
||||
@@ -67,18 +67,19 @@ namespace Tnb.EquipMgr
|
||||
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.execute_user_id == c.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(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" && end_time != null, a => a.execute_time <= end_time)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.Select((a, b, c, d) => new EqpMaintainRecordListOutput
|
||||
.Select((a, b, c, d,e) => new EqpMaintainRecordListOutput
|
||||
{
|
||||
id = a.id,
|
||||
equip_id = b.code + "/" + b.name,
|
||||
@@ -95,6 +96,9 @@ namespace Tnb.EquipMgr
|
||||
repeat_user_id_id = a.repeat_user_id,
|
||||
result_remark = a.result_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)
|
||||
})
|
||||
.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.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.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);
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
[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;
|
||||
}
|
||||
|
||||
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.spot_record_user_id == c.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(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)
|
||||
.Where(a => a.create_time.Value.ToString("yyyy-MM-dd") == now)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.Select((a, b, c, d) => new EqpSpotInsRecordListOutput
|
||||
.Select((a, b, c, d,e) => new EqpSpotInsRecordListOutput
|
||||
{
|
||||
id = a.id,
|
||||
equip_id = b.code + "/" + b.name,
|
||||
@@ -93,6 +94,9 @@ namespace Tnb.EquipMgr
|
||||
spot_record_user_id_id = a.spot_record_user_id,
|
||||
repeat_user_id = d.RealName,
|
||||
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 =>
|
||||
{
|
||||
@@ -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.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.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);
|
||||
|
||||
@@ -253,5 +258,28 @@ namespace Tnb.EquipMgr
|
||||
}).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;
|
||||
}
|
||||
|
||||
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.execute_user_id == c.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(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" && end_time != null, a => a.execute_time <= end_time)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.Select((a, b, c, d) => new ToolMoldMaintainRecordListOutput
|
||||
.Select((a, b, c, d,e) => new ToolMoldMaintainRecordListOutput
|
||||
{
|
||||
id = a.id,
|
||||
mold_id = b.mold_code + "/" + b.mold_name,
|
||||
@@ -95,7 +96,10 @@ namespace Tnb.EquipMgr
|
||||
repeat_user_id_id = a.repeat_user_id,
|
||||
result_remark = a.result_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 =>
|
||||
{
|
||||
@@ -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.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.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);
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
[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("状态错误");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user