点巡检 设备模具保养执行修改
This commit is contained in:
@@ -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("状态错误");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user