Commit c5d21b23 authored by liudong1993's avatar liudong1993

商品调整

parent 072f08ba
......@@ -3838,7 +3838,7 @@ namespace Mall.Module.Product
return ApiResult.Failed("商品服务类型不一致");
}
int uday = Convert.ToInt32((gmodel.UseDay ?? 0).Equals(0.5) ? 1 : (gmodel.UseDay ?? 0));
if (demodel.TripSTime.Value.AddDays(uday - 1) != demodel.TripETime)
if (demodel.TripSTime.Value.AddDays(uday - 1).ToString("yyyy-MM-dd") != demodel.TripETime.Value.ToString("yyyy-MM-dd"))
{
return ApiResult.Failed("预定日期与商品使用天数不一致");
}
......@@ -3854,6 +3854,8 @@ namespace Mall.Module.Product
item.CarColorId = gmodel.CarColorId;
item.CarNumber = gmodel.CarNumber;
item.LineName = gmodel.LineName;
item.Specification = "[]";
item.SpecificationSort = "0";
var tdlist = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = item.GoodsId ?? 0, StartTime = item.TripSTime.Value.ToString("yyyy-MM-dd"), EndTime = item.TripETime.Value.ToString("yyyy-MM-dd") });
var targetList = tdlist.Where(x => x.IsReserve == 1 && x.Date == Convert.ToDateTime(demodel.TripSTime.Value.ToString("yyyy-MM-dd"))).ToList();
......@@ -5991,7 +5993,8 @@ namespace Mall.Module.Product
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem
FiledValue=qitem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
......@@ -6792,7 +6795,7 @@ namespace Mall.Module.Product
{
//剑鱼兄需求 2020=07-30 再查询一次商品表
string GoodsIds = string.Join(",", dlist.Select(x => x.GoodsId).Distinct());
var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds });
var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true);
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
......
......@@ -305,9 +305,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Extend> GetSingleListForGoodsSubName(RB_Goods_Extend dmodel)
public List<RB_Goods_Extend> GetSingleListForGoodsSubName(RB_Goods_Extend dmodel, bool IsSelectAll = false)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.GoodsClassify=0";
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 ";
if (IsSelectAll == false) {
where += $@" and g.GoodsClassify=0 ";
}
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
......
......@@ -551,6 +551,12 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.IsSpell ??= 1;
demodel.AdvanceDay ??= 0;
if (demodel.TargetDateList != null && demodel.TargetDateList.Any()) {
//去除重复
if (demodel.TargetDateList.Count() != demodel.TargetDateList.Select(x => x.Date).Distinct().Count()) {
return ApiResult.ParamIsNull("可预定日期有重复");
}
}
if (demodel.Id > 0)
{
string vmsg = guideCarModule.ValidateGoodsTargetDate(demodel.Id, demodel.TargetDateList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment