|
@ -228,13 +228,46 @@ namespace Coldairarrow.Business.HuiYan |
|
|
return DeleteItem(id); |
|
|
return DeleteItem(id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var priceUserId = Db.GetIQueryable<teamitems>().FirstOrDefault(c => c.Id == id).PriceTaskUserId; |
|
|
|
|
|
|
|
|
|
|
|
var result= Db.RunTransaction(() => |
|
|
|
|
|
{ |
|
|
int row = Db.Update<teamitems>(c => c.Id == id, (item) => |
|
|
int row = Db.Update<teamitems>(c => c.Id == id, (item) => |
|
|
{ |
|
|
{ |
|
|
item.State = state; |
|
|
item.State = state; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (row > 0) |
|
|
if (row <= 0) |
|
|
return Success(); |
|
|
throw new Exception("任务状态设置失败!"); |
|
|
|
|
|
//同步更新比价任务状态
|
|
|
|
|
|
if ((Entity.Enum.TeamItemState)state == TeamItemState.待修改) |
|
|
|
|
|
{ |
|
|
|
|
|
row = Db.Update<pricetasklog>(c => c.UserId == priceUserId && c.TeamItemId == id, (item) => |
|
|
|
|
|
{ |
|
|
|
|
|
item.State = PriceTaskState.待修改; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (row <= 0) |
|
|
|
|
|
throw new Exception("比价任务设置失败!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((Entity.Enum.TeamItemState)state == TeamItemState.精选) |
|
|
|
|
|
{ |
|
|
|
|
|
row = Db.Update<pricetasklog>(c => c.UserId == priceUserId && c.TeamItemId == id, (item) => |
|
|
|
|
|
{ |
|
|
|
|
|
item.State = PriceTaskState.比价完成; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (row <= 0) |
|
|
|
|
|
throw new Exception("比价任务设置失败!"); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (result.Success) |
|
|
|
|
|
{ |
|
|
|
|
|
return Success("更新成功"); |
|
|
|
|
|
} |
|
|
return Error("操作失败!"); |
|
|
return Error("操作失败!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|