功能优化 成品调拨入库
This commit is contained in:
@@ -170,22 +170,44 @@ namespace Tnb.EquipMgr
|
||||
[HttpPost]
|
||||
public async Task<string> Receive(Dictionary<string, string> dic)
|
||||
{
|
||||
// string id = dic["id"];
|
||||
// EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id);
|
||||
// if (eqpRepairApply.status == RepairApplyStatus.TOBERECEIVED)
|
||||
// {
|
||||
// if (_userManager.UserId == eqpRepairApply.repairer_id)
|
||||
// {
|
||||
// _ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
// {
|
||||
// status = RepairApplyStatus.RECEIVED,
|
||||
// }, x => x.id == id);
|
||||
// return "接收成功";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// throw Oops.Bah("该任务没有指派给您,无法接收");
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// throw Oops.Bah("状态错误");
|
||||
// }
|
||||
|
||||
string id = dic["id"];
|
||||
EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id);
|
||||
if (eqpRepairApply.status == RepairApplyStatus.TOBERECEIVED)
|
||||
{
|
||||
if (_userManager.UserId == eqpRepairApply.repairer_id)
|
||||
if (await _repository.AsSugarClient().Queryable<UserRelationEntity>().AnyAsync(x => x.UserId == _userManager.UserId && x.ObjectId == "26586914497557"))
|
||||
{
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
status = RepairApplyStatus.RECEIVED,
|
||||
}, x => x.id == id);
|
||||
return "接收成功";
|
||||
}
|
||||
else
|
||||
}else
|
||||
{
|
||||
throw Oops.Bah("该任务没有指派给您,无法接收");
|
||||
throw Oops.Bah("不是设备管理部的,无法接收");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user