|
@ -90,9 +90,10 @@ namespace Coldairarrow.Business.HuiYan |
|
|
|
|
|
|
|
|
//查询对应状态
|
|
|
//查询对应状态
|
|
|
var where = LinqHelper.True<TeamitemDto>().And(c => c.State == int.Parse(search.Keyword)); |
|
|
var where = LinqHelper.True<TeamitemDto>().And(c => c.State == int.Parse(search.Keyword)); |
|
|
|
|
|
|
|
|
where = where.And(c => c.TeamId == _operator.TeamId); |
|
|
where = where.And(c => c.TeamId == _operator.TeamId); |
|
|
|
|
|
|
|
|
var list = q.Where(where).GetPageResultAsync(input).Result; |
|
|
var list = q.Where(where).GetPageResultAsync(input).Result; |
|
|
|
|
|
|
|
|
return list; |
|
|
return list; |
|
|
|
|
|
|
|
@ -116,7 +117,7 @@ namespace Coldairarrow.Business.HuiYan |
|
|
GoodsId = model.GoodsId, |
|
|
GoodsId = model.GoodsId, |
|
|
|
|
|
|
|
|
CreateTime = DateTime.Now, |
|
|
CreateTime = DateTime.Now, |
|
|
CreatorId =_operator.UserId, |
|
|
CreatorId = _operator.UserId, |
|
|
Deleted = false, |
|
|
Deleted = false, |
|
|
HasFilter = false, |
|
|
HasFilter = false, |
|
|
Id = IdHelper.GetId(), |
|
|
Id = IdHelper.GetId(), |
|
@ -143,7 +144,7 @@ namespace Coldairarrow.Business.HuiYan |
|
|
Id = IdHelper.GetId(), |
|
|
Id = IdHelper.GetId(), |
|
|
|
|
|
|
|
|
TeamId = _operator.TeamId, |
|
|
TeamId = _operator.TeamId, |
|
|
UserId =_operator.UserId, |
|
|
UserId = _operator.UserId, |
|
|
|
|
|
|
|
|
Price = model.Price, |
|
|
Price = model.Price, |
|
|
ItemImg = model.ItemImg, |
|
|
ItemImg = model.ItemImg, |
|
@ -168,12 +169,13 @@ namespace Coldairarrow.Business.HuiYan |
|
|
model.RivalGoodsId = Regex.Match(model.RivalGoodsId + "&", "id=(.*?)&").Groups[1].Value; |
|
|
model.RivalGoodsId = Regex.Match(model.RivalGoodsId + "&", "id=(.*?)&").Groups[1].Value; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
int row= Db.Update<teamitems>(c=>c.Id==model.Id,(item)=> { |
|
|
int row = Db.Update<teamitems>(c => c.Id == model.Id, (item) => |
|
|
|
|
|
{ |
|
|
item.ExtensionJson = Newtonsoft.Json.JsonConvert.SerializeObject(model.Extensions); |
|
|
item.ExtensionJson = Newtonsoft.Json.JsonConvert.SerializeObject(model.Extensions); |
|
|
item.RivalGoodsId = model.RivalGoodsId; |
|
|
item.RivalGoodsId = model.RivalGoodsId; |
|
|
item.RivalPLCount = model.RivalPLCount; |
|
|
item.RivalPLCount = model.RivalPLCount; |
|
|
item.RivalPrice = model.RivalPrice; |
|
|
item.RivalPrice = model.RivalPrice; |
|
|
item.RivalTitle = model.RivalTitle; |
|
|
item.RivalTitle = model.RivalTitle; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (row > 0) |
|
|
if (row > 0) |
|
@ -182,7 +184,7 @@ namespace Coldairarrow.Business.HuiYan |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AjaxResult SetState(string id,int state) |
|
|
public AjaxResult SetState(string id, int state) |
|
|
{ |
|
|
{ |
|
|
//删除
|
|
|
//删除
|
|
|
if (state == 4) |
|
|
if (state == 4) |
|
@ -190,7 +192,8 @@ namespace Coldairarrow.Business.HuiYan |
|
|
return DeleteItem(id); |
|
|
return DeleteItem(id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
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; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -202,9 +205,10 @@ namespace Coldairarrow.Business.HuiYan |
|
|
|
|
|
|
|
|
public AjaxResult DeleteItem(string id) |
|
|
public AjaxResult DeleteItem(string id) |
|
|
{ |
|
|
{ |
|
|
var titem = Db.GetIQueryable<teamitems>().FirstOrDefault(c => c.Id == id); |
|
|
|
|
|
|
|
|
string itemId = Db.GetIQueryable<teamitems>().FirstOrDefault(c => c.Id == id)?.ItemId; |
|
|
|
|
|
|
|
|
var result= Db.RunTransaction(() => |
|
|
var result = Db.RunTransaction(() => |
|
|
{ |
|
|
{ |
|
|
var row = Db.Delete<teamitems>(c => c.Id == id); |
|
|
var row = Db.Delete<teamitems>(c => c.Id == id); |
|
|
|
|
|
|
|
@ -212,7 +216,8 @@ namespace Coldairarrow.Business.HuiYan |
|
|
{ |
|
|
{ |
|
|
throw new Exception("操作失败!"); |
|
|
throw new Exception("操作失败!"); |
|
|
} |
|
|
} |
|
|
row = Db.Update<itemlabels>(c => c.ItemsId == titem.ItemId && c.TeamId == _operator.TeamId, (item) => |
|
|
|
|
|
|
|
|
row = Db.Update<itemlabels>(c => c.ItemsId == itemId && c.TeamId == _operator.TeamId, (item) => |
|
|
{ |
|
|
{ |
|
|
//item.IsScreening = false;
|
|
|
//item.IsScreening = false;
|
|
|
item.IsAdded = false; |
|
|
item.IsAdded = false; |
|
@ -220,7 +225,7 @@ namespace Coldairarrow.Business.HuiYan |
|
|
|
|
|
|
|
|
if (row <= 0) |
|
|
if (row <= 0) |
|
|
{ |
|
|
{ |
|
|
throw new Exception("删除失败!"); |
|
|
throw new Exception($"删除失败!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
@ -230,7 +235,7 @@ namespace Coldairarrow.Business.HuiYan |
|
|
return Success(); |
|
|
return Success(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return Error(); |
|
|
return Error(result.ex.Message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |